Re: [RFC] Fix inconsistent behavior of $this variable
| From: | Stanislav Malyshev | Date: | Tue, 24 May 2016 06:54:17 +0000 |
| Subject: | Re: [RFC] Fix inconsistent behavior of $this variable | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93469@lists.php.net to get a copy of this message | ||
Hi!
> Please review the RFC.
>
> It proposes to fix all known inconsistencies related to handling of special $this variable.
>
> https://wiki.php.net/rfc/this_var
What is the reason behind all these changes? Does it serve some bigger
purpose? I'm not sure I currently see a reason to go to all these
lengths. Sure, you can re-assign $this and make things weird. But I
don't see why it's important to prevent it. It seems to add a lot of
code, including checks in various places that would slow down things
(and since these checks need to be done in each and every place we deal
with local variables, it is also a very brittle design - each time we
change or add anything there we'd need to remember forever to include
special case for "this").
Also notes:
1. How static __call is a thing? That looks like something that makes no
sense at all.
2. Why get_defined_vars() shouldn't show $this?
--
Stas Malyshev
smalyshev@gmail.com