Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60199 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20558 invoked from network); 18 Apr 2012 20:34:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Apr 2012 20:34:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.163 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.163 smtp163.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.163] ([67.192.241.163:53951] helo=smtp163.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 61/23-03623-2552F8F4 for ; Wed, 18 Apr 2012 16:34:26 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp16.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id D34CE4019E; Wed, 18 Apr 2012 16:34:23 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp16.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 7C9634042C; Wed, 18 Apr 2012 16:34:23 -0400 (EDT) Message-ID: <4F8F254F.4080100@sugarcrm.com> Date: Wed, 18 Apr 2012 13:34:23 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: Gustavo Lopes CC: PHP Internals References: <4F8DF4B1.2040307@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] skipping optional parameters From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > This would cause a lot of problems. Basically, all the functions that rely > on ZEND_NUM_ARGS() will have to be changed. You can't tell if a parameter > was passed or not by relying on it. ZEND_NUM_ARGS() would probably work since IIRC it relies on stack size, not on varargs return. Yes, that means ZEND_NUM_ARGS() and varargs would return different things, and that means when you manually fetch args from stack you'd have to check for NULLs - but these cases should be quite rare and can be handled on case-by-case basis. Most functions don't - and shouldn't - use manual stack parsing, and for those everything would work just fine. > the strong presumption that exists against new syntax changes. Maybe I'm > lucky, but the problem you're trying to solve is at most an occasional > minor nuisance for me. Plus, this solution encourages bad behavior. If we Please look at the RFC, it has links to multiple requests from users for this feature. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227