Re: property de-referencing
| From: | Lazare Inepologlou | Date: | Tue, 30 Apr 2013 22:20:07 +0000 |
| Subject: | Re: property de-referencing | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-67227@lists.php.net to get a copy of this message | ||
2013/4/30 Rasmus Lerdorf <rasmus@lerdorf.com>
> On 04/30/2013 01:58 PM, Stas Malyshev wrote:
> > Hi!
> >
> >> I'm proposing we need a way to statically reference an object property -
> >> the object property itself, not it's value:
> >
> > You probably have use case for that, and it should be pretty easy to
> > write a class that does that, but why it should be in the language? It
> > certainly doesn't look like something sizeable portion of PHP devs would
> > do frequently.
>
> It is certainly not worth overloading the XOR operator for.
>
> -Rasmus
>
>
In C#, they had the intention to introduce the operator infoof(...) to get
the reflection, not only of properties, but of virtually everything in the
language. They abandoned the idea because it is really hard to do that for
overloaded functions and they did not want to do all that work for a half
baked feature:
http://blogs.msdn.com/b/ericlippert/archive/2009/05/21/in-foof-we-trust-a-dialogue.aspx
However, PHP does not have overloaded functions, which makes things
significantly easier, so maybe it is worth examining the idea.
Lazare INEPOLOGLOU
Ingénieur Logiciel