Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33892 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82000 invoked by uid 1010); 10 Dec 2007 05:20:33 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 81985 invoked from network); 10 Dec 2007 05:20:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Dec 2007 05:20:33 -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.185 cause and error) X-PHP-List-Original-Sender: steph@zend.com X-Host-Fingerprint: 64.97.136.185 smtpout0185.sc1.he.tucows.com Solaris 8 (1) Received: from [64.97.136.185] ([64.97.136.185:9432] helo=n068.sc1.he.tucows.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D7/BF-53444-0ACCC574 for ; Mon, 10 Dec 2007 00:20:33 -0500 Received: from sc1-out04.emaildefenseservice.com (64.97.139.2) by n068.sc1.he.tucows.com (7.2.069.1) id 47586AEC0009D4E6; Mon, 10 Dec 2007 05:20:26 +0000 X-SpamScore: 2 X-Spamcatcher-Summary: 2,0,0,d2bba9ce9974245d,86f1fe7bf2bcddd7,steph@zend.com,-,RULES_HIT:355:379:539:540:541:542:543:567:599:601:945:982:988:989: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:2198:2199:2393:2559:2562:2692:2828:3027:3353:3865:3866:3867:3868:3869:3870:3871:3872:3873:3874:4250:5007:6119:6120:6261,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-out04.emaildefenseservice.com (Postfix) with ESMTP; Mon, 10 Dec 2007 05:20:25 +0000 (UTC) Message-ID: <018b01c83aec$7413b2c0$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> Date: Mon, 10 Dec 2007 05:20:58 -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") >>> I think in fact it should just parse it as long and not as zval - what >>> would be any reason to parse it as zval and then convert to long anyway? >> >> The problem is that this function's always been wrong, so it doesn't >> really care what you throw at it - it just does a silent conversion to >> long if you get it wrong. If you turn the parameter into a long now, > > Right, that's what "l" parameter spec is doing, doesn't it? Why convert it > manually? Because it doesn't know the difference between NULL and 0 if it's a long. >> There's also the issue of what to do about inappropriate vs appropriate >> input types, since we can't rely on zend_parse_parameters() to >> psychically know that this particular zval is really a loose long kind of >> thing... so I tried: > > What's "loose long"? One that doesn't break every script that didn't strictly stay with int over the last 8 years or so. >> So - not as straightforward as it looks, whatever way you look at it. >> Maybe we should just revert to the old, messy but mostly working code for >> array_slice()? > > I still don't understand what prevents one from using new parameter > parsing API and why manual conversions doing the same are needed. See above. Unless you know a way to make IS_NULL work the same way with a long as it does with a zval anyways. - Steph