I’m not sure if this is exactly the same topic, but one problem I have with how 
internal functions are handling arguments is how the absence of an optional 
argument is treated.

I have stumbled across functions documented as functionname($arg1, $arg2 = 
NULL) which behaves differently when called as functionname('something') and 
functionname('something', NULL).
A lot of places in the documentation state "if omitted" about an argument.

This is a big problem when several arguments are optional and you just want to 
provide a value for the last one. You cannot know if giving the default value 
for the ones in between will affect the behavior.

Shouldn’t the argument parsing system treat absence the same as the default 
value?
This is what happens for userland functions.

Côme

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

Reply via email to