On Wed, 18 Apr 2012 00:54:41 +0200, Stas Malyshev <smalys...@sugarcrm.com>
wrote:

[snip]
https://wiki.php.net/rfc/skipparams

[snip]

«For internal functions, parameter parser will ignore the NULLs, thus
leaving the defaults supplied by the caller intact. Again, skipping
non-optional parameter is an error.»

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.

For instance, if you have ZEND_NUM_ARGS() yielding x, but skipped arg x -
y, now the variable for the argument x - y won't be touched but the
function will think the argument was supplied. Segfaults and unpredictable
behavior due to uninitialized values and other logic errors will follow.

Of course, this because internal functions don't have "default values", at
least not the same way user-land functions do.

This seems a lot of trouble for a feature that, in my opinion, even if it
could be implemented without problems, won't be useful enough to overcome
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
want to properly support long argument lists (and I'm not we do), we have
to have named parameters.

--
Gustavo Lopes

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to