Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33907 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30106 invoked by uid 1010); 10 Dec 2007 19:23:34 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 30091 invoked from network); 10 Dec 2007 19:23:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Dec 2007 19:23:34 -0000 Authentication-Results: pb1.pair.com header.from=steph@zend.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=steph@zend.com; spf=permerror; sender-id=softfail Received-SPF: error (pb1.pair.com: domain zend.com from 64.97.136.188 cause and error) X-PHP-List-Original-Sender: steph@zend.com X-Host-Fingerprint: 64.97.136.188 smtpout0188.sc1.he.tucows.com Solaris 8 (1) Received: from [64.97.136.188] ([64.97.136.188:48603] helo=n066.sc1.he.tucows.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 42/DD-37002-5329D574 for ; Mon, 10 Dec 2007 14:23:34 -0500 Received: from sc1-out05.emaildefenseservice.com (64.97.139.2) by n066.sc1.he.tucows.com (7.2.069.1) id 47586DDB000847EB; Mon, 10 Dec 2007 19:23:28 +0000 X-SpamScore: 50 X-Spamcatcher-Summary: 50,0,0,4993133d2d08cbe9,86f1fe7bf2bcddd7,steph@zend.com,-,RULES_HIT:355:379:539:540:541:542:543:567:599:601:967:973:988:989:1042:1155:1156:1260:1277:1311:1313:1314:1345:1437:1515:1516:1518:1534:1541:1587:1593:1594:1711:1730:1747:1766:1792:2073:2075:2078:2380:2393:2525:2560:2563:2682:2685:2828:2857:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3027:3352:3865:3867:3868:3869:3870:3872:3873:3934:3936:3938:3941:3944:4321:4605:5007:6120:6261:7679,0,RBL:none, CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:none,DNSBL:none X-Spamcatcher-Explanation: Received: from foxbox (unknown [64.97.206.40]) (Authenticated sender: steph.fox) by sc1-out05.emaildefenseservice.com (Postfix) with ESMTP; Mon, 10 Dec 2007 19:23:27 +0000 (UTC) Message-ID: <023301c83b62$36614fc0$e6dfc350@foxbox> Reply-To: "Steph Fox" To: "Stanislav Malyshev" Cc: References: <46.93.08781.F374D474@pb1.pair.com> <474d5320.0d135e0a.43d0.ffffd2b3@mx.google.com> <474D6813.9090606@eenterphace.org> <474DB7F8.5010907@zend.com> <016b01c83ae3$c3acfb60$e6dfc350@foxbox> <475CCA82.2010204@zend.com> <018b01c83aec$7413b2c0$e6dfc350@foxbox> <475CD134.9020005@zend.com> <00c001c83b4c$12cb0f30$e6dfc350@foxbox> <475D7F3B.30504@zend.com> <020c01c83b5d$93c04db0$e6dfc350@foxbox> <475D8D76.3070909@zend.com> Date: Mon, 10 Dec 2007 19:23:07 -0000 Organization: Zend Technologies MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Subject: Re: [PHP-DEV] question regarding type hinting parameters of php functions (array_slice) From: steph@zend.com ("Steph Fox") >> if (ZEND_NUM_ARGS() >= 3 && Z_TYPE_P(length_param) != IS_NULL) { >> + convert_to_long(length_param); > > Isn't convert_to_long non-separating one? I think the variable supposed to > be separated before conversion, so convert_to_long_ex (and zval **) would > be in place. Hm you're probably right... if (ZEND_NUM_ARGS() >= 3 && Z_TYPE_P(length_param) != IS_NULL) { + convert_to_long_ex(&length_param); length = Z_LVAL_P(length_param); } else { length = num_in; - because it's a zval * these days. convert_to_long() didn't break it when I checked, though I probably have the length assignment wrong in the one I posted, on reflection. (Too many patches floating around here at present, sorry.) >> + if (length == IS_NULL) { > > Did you really mean IS_NULL here? It builds without complaint and works as expected - what am I missing? - Steph > -- > Stanislav Malyshev, Zend Software Architect > stas@zend.com http://www.zend.com/ > (408)253-8829 MSN: stas@zend.com