Re: [RFC] Remove calls with incompatible Context
| From: | Todd Ruth | Date: | Mon, 30 Jul 2012 19:11:58 +0000 |
| Subject: | Re: [RFC] Remove calls with incompatible Context | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-61882@lists.php.net to get a copy of this message | ||
On Mon, 2012-07-30 at 19:31 +0200, Gustavo Lopes wrote:
> https://wiki.php.net/rfc/incompat_ctx
>
> An RFC for deprecating and removing $this from incompatible context.
>
> Comments are welcome.
>
> --
> Gustavo Lopes
I'm just a user, but I'd like to beg that the feature not be
removed, at least not without having an ini setting for at least
a couple of years. As the RFC states, "This feature can, however,
be used to implement trait-like behavior, and I'm sure someone
somewhere did such a thing." I know in our company's code, such
uses were frequent. I believe they are still common. Refactoring
often doesn't fit the schedule. I doubt we're unusual in allowing
classes to do more than they should instead of separating code
off into a trait or making other high level changes. Note that
traits have only been available since March 1, 2012 (php 5.4.0).
I don't think axing register globals is very relevant. Perhaps after
traits have been available for several years the comparison would
be better. With register globals, a good alternative (the $_
variables) have been around for many years. With traits, a good
alternative has been around for a few months. I think the point
of mentioning register globals is just to say "We've made huge
BC breaks before." That doesn't make it less painful.
Off-topic, but to show a potentially higher priority...
If you want to get rid of class related WTF, please put
get_class() back to the way it used to be. Right now, calling
get_class() with a variable that is null is the same as calling
get_class with no arguments. I can imagine why that might be
convenient for the implementation, but it is terribly confusing.
Thanks for listening.
- Todd