Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61520 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11762 invoked from network); 19 Jul 2012 21:38:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jul 2012 21:38:45 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.123 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.123 smtp123.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.123] ([67.192.241.123:37044] helo=smtp123.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 27/5B-18983-26E78005 for ; Thu, 19 Jul 2012 17:38:43 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp12.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id B6DBE3C19B1; Thu, 19 Jul 2012 17:38:39 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp12.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 572A03C19B9; Thu, 19 Jul 2012 17:38:39 -0400 (EDT) Message-ID: <50087E5E.8080209@sugarcrm.com> Date: Thu, 19 Jul 2012 14:38:38 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Nikita Popov CC: Sara Golemon , Gustavo Lopes , "internals@lists.php.net" References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] zend_parse_parameters() improvements From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > This solves two problems: > > a) Integer parameters cannot currently be skipped using NULL. This > issue comes up every now and then. E.g. see > https://github.com/php/php-src/pull/133. Again, I think param skipping RFC addresses this better, but having some way to see if param was supplied or not can be useful. Right now since there's no "out of range" value for ints - like NULL for pointers - it's impossible to know it. So this is one thing that's indeed missing for all non-pointer types in zpp. > b) If you need more complex argument handling you currently have to > fetch the value as z and then use some convert_to_* function. But > those convert_to_* functions behave differently than zpp. So a > function for parsing a single parameter is exposed too. I agree that being able to use zpp on single parameter might lead to a cleaner code - we've had some bugs where handmade args parsing was done wrong. So I think this RFC is a good addition. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227