Re: Handling of null arguments to internal functions

From: Date: Thu, 06 Jun 2019 10:10:05 +0000
Subject: Re: Handling of null arguments to internal functions
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-105846@lists.php.net to get a copy of this message
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

« previous php.internals (#105846) next »