Dan Ackroyd wrote on 28/01/2016 22:35:
## Refactoring if non-objects are no longer allowed.

Current code:
echo get_class($result);

Would need to be changed to:

if ($result === null) {
     echo get_class();
}
else {
echo get_class($result);
}

You appear to be suggesting that "get_class()" should behave differently than "get_class(null)". Normally a function doesn't distinguish between "called with no parameters" and "called with default parameters". I don't know if internal parameter handling (ZPP) works like userland parameters in this respect, but if not impossible this would at least be rather surprising.

It also doesn't help with your stated point of using get_class as a callable, since you'd have to know what function it was in order to call it in the right way (although exactly what the use case for that would be, I've no idea).

Regards,
Rowan Collins
--
[IMSoP]

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

Reply via email to