Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33891 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78823 invoked by uid 1010); 10 Dec 2007 05:11:39 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 78808 invoked from network); 10 Dec 2007 05:11:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Dec 2007 05:11:38 -0000 Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:27909] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3A/5F-53444-98ACC574 for ; Mon, 10 Dec 2007 00:11:38 -0500 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 10 Dec 2007 07:11:33 +0200 Received: from [192.168.17.28] ([192.168.17.28]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.1830); Sun, 9 Dec 2007 21:11:30 -0800 Message-ID: <475CCA82.2010204@zend.com> Date: Sun, 09 Dec 2007 21:11:30 -0800 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Steph Fox CC: internals@lists.php.net 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> In-Reply-To: <016b01c83ae3$c3acfb60$e6dfc350@foxbox> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 10 Dec 2007 05:11:30.0805 (UTC) FILETIME=[1FF6C250:01C83AEB] Subject: Re: [PHP-DEV] question regarding type hinting parameters of php functions (array_slice) From: stas@zend.com (Stanislav Malyshev) >> 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? > 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"? > 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. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com