On 29 January 2016 at 10:46, Rowan Collins <rowan.coll...@gmail.com> wrote:
>
> You appear to be suggesting that "get_class()" should behave differently
> than "get_class(null)".
> I don't know if internal parameter handling (ZPP) works like userland
> parameters

Regardless of how internals works, it's a thing in userland PHP.

function foo($bar = null)
{
    echo "number of args is: ".func_num_args(). "\n";
}

foo();
foo(null);

// Output is:
// number of args is: 0
// number of args is: 1

It's a useful thing to do when you want to distinguish between null
being passed, and the default value being used. Just like in this
case. The same is possible for internal functions.

cheers
Dan

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

Reply via email to