Re: [RFC] Remove calls with incompatible Context
| From: | Andrew Faulds | Date: | Wed, 01 Aug 2012 11:22:27 +0000 |
| Subject: | Re: [RFC] Remove calls with incompatible Context | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-61913@lists.php.net to get a copy of this message | ||
Slightly off-topic, $this being equal to NULL reminds me of how ECMAScript 5
changed the value of "this" to "undefined" in strict mode when not being called
as a method. I agree it's a more sensible solution, as the disappearance of a
variable might be more difficult to deal with than a variable changing value.
With the latter, you can just do var_dump($this) and see it is now NULL, which I
expect would be less confusing than it suddenly not being present.
On 30 July 2012 at 21:13 Gustavo Lopes <glopes@nebm.ist.utl.pt> wrote:
> Em Mon, 30 Jul 2012 19:42:59 +0200, Will Fitch <willfitch@php.net>
> escreveu:
>
> > I think this is a good idea. I agree with the intention of throwing
> > E_DEPRECATED in 5.5, but what do you propose happen afterwards? Throw a
> > fatal error? I would just like to make "removing (in the next version)"
> > a little more definitive.
> >
>
> As much as I'd like to have an error at call site here, the most sensible
> option is to just have $this === null inside the callee, like when you do:
>
> class A { function foo() {} }
> A::foo(); // E_STRICT
>
> I'll update the RFC with this.
>
> --
> Gustavo Lopes
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
Andrew Faulds
http://ajf.me/