Re: Closure::call() to access private data, really ?
| From: | Marco Pivetta | Date: | Fri, 17 Apr 2015 20:03:56 +0000 |
| Subject: | Re: Closure::call() to access private data, really ? | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-85858@lists.php.net to get a copy of this message | ||
On 17 April 2015 at 18:43, Ferenc Kovacs <tyra3l@gmail.com> wrote:
> For the record this isn't exclusive to Closure::call, afaik the same thing
> is possible with Closure::bind() since 5.4
> http://3v4l.org/hlFS4
> And there are/were a decent amount of discussion (and AFAIR even hydrate
> libraries using this trick) about this, for example:
>
>
> http://ocramius.github.io/blog/accessing-private-php-class-members-without-reflection/
>
Also note that this is the only way to access private properties by-ref
(yes, I do need that for my horrible use-cases. No, don't ask about it.)
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/