What is the difference between two. both of these are working exactly in a same way.
public static function getArgsArray($reflectionMethod,$argArray){
$a
Good question. Consider this example
function foo($foo = 'foo', $bar) {}
For the $foo
parameter, isDefaultValueAvailable()
would understandably return true
however isOptional()
would return false
as the next parameter ($bar
) has no default value and is therefore not optional. To support the non-optional $bar
parameter, $foo
must itself be non-optional.
Hope this makes sense ;)
I've noted that behaviour differs across PHP versions. 5.5 returns the above whereas 5.4 says parameter 1 is both not optional and has no default value.