Re: [RFC] skipping optional parameters
| From: | Stas Malyshev | Date: | Wed, 18 Apr 2012 20:34:23 +0000 |
| Subject: | Re: [RFC] skipping optional parameters | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-60199@lists.php.net to get a copy of this message | ||
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