On 26.08.2016 at 16:48, Levi Morrison wrote: > On Fri, Aug 26, 2016 at 4:53 AM, Christoph M. Becker <cmbecke...@gmx.de> > wrote: > >> Finally, I wonder why array_diff(), for instance, even has an explicit >> check for ZEND_NUM_ARGS() and for Z_TYPE() != IS_ARRAY instead of >> properly invoking zend_parse_parameters() with "aa+" instead of "+" in >> the first place? Maybe I'm missing something, but otherwise I would >> suggest to fix that altogether instead of piecemeal, even if that has to >> wait until 8.0. > > Well, its behavior does differ with a single array: it will preserve > keys in this case. If more than one array is passed it will > numerically index the keys starting at zero. This is the only reason I > can think of.
Indeed, I've overlooked that array_diff() accepts a single array. So, ZPP could use "aa*". My point is that it's better to rely on common checks (and respective errors), than to have individual checks for each (group of) function(s). If that had already been the case, we wouldn't need to have this discussion. :-) -- Christoph M. Becker -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php