Re: Re: [RFC] get_class() disallow null parameter
| From: | Stanislav Malyshev | Date: | Mon, 15 Aug 2016 00:09:35 +0000 |
| Subject: | Re: Re: [RFC] get_class() disallow null parameter | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-95158@lists.php.net to get a copy of this message | ||
Hi!
> Prohibiting
get_class(NULL) is certainly a good idea, but I
> have some
> concerns regarding BC. While __CLASS__ has been introduced
> with PHP
> 4.3.0, it had the glitch to return the lower-cased class name before PHP
> 5.0.0. So there *might* still be PHP 5 code around using
> get_class(NULL).
I note that this (i.e. behavior proposed in the RFC) was briefly the
case for 5.3.0 and was changed to current behavior for 5.3.1. But
pre-5.3 versions return false when NULL is passed to get_class, with no
message.
So, old PHP code doesn't seem to be a problem only one that was written
after 5.3.1, because it doesn't look like get_class(NULL) worked before
it: https://3v4l.org/4QvCs
--
Stas Malyshev
smalyshev@gmail.com