Re: [RFC] get_class() disallow null parameter
| From: | Marco Pivetta | Date: | Sun, 14 Aug 2016 18:01:10 +0000 |
| Subject: | Re: [RFC] get_class() disallow null parameter | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-95142@lists.php.net to get a copy of this message | ||
Hi Dan,
On Sun, Aug 14, 2016 at 1:00 PM, Dan Ackroyd <danack@basereality.com> wrote:
> Hi!
>
> Following an earlier discussion in January, here is a small RFC to
> change get_class() to disallow null being passed as parameter.
>
> https://wiki.php.net/rfc/get_class_disallow_null_parameter
>
> Allowing null to be passed to get_class() is a 'gotcha' that is almost
> always a mistake in someone's code.
>
> By preventing null being passed, get_class() will be far more likely
> to do what people think it should do, and so result in fewer bugs in
> code.
>
> This RFC is a small change and so is appropriate for a point release.
> Other ways of making this function behave as people expect it to are
> not as small changes, and are probably not appropriate for point
> releases.
>
Thanks for bringing up this: every scenario where
null has been passed to
get_class() was a bug, in my work context, so I'm really happy to see
this patch going in.
Still, can any of the release managers throw their opinion at the RFC?
This is a SemVer violation, but it doesn't seem like PHP follows SemVer
closely, so I'm a bit confused about whether this can target 7.x.
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/