Re: [RFC] Pass Scope to Magic Accessors
| From: | Marco Pivetta | Date: | Thu, 19 Jan 2023 18:40:04 +0000 |
| Subject: | Re: [RFC] Pass Scope to Magic Accessors | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-119354@lists.php.net to get a copy of this message | ||
Not just that, but
debug_backtrace() already exists for that purpose.
On Thu, 19 Jan 2023, 19:23 Aleksander Machniak, <alec@alec.pl> wrote:
> On 19.01.2023 17:23, Nicolas Grekas wrote:
> > Hi internals,
> >
> > Ilija and I would like to start a discussion about the following RFC:
> > https://wiki.php.net/rfc/pass_scope_to_magic_accessors
> >
> > When using magic methods to access actual properties, respecting their
> > declared visibility is often desired. Yet, accessing the calling scope to
> > emulate the visibility restrictions is unreasonably difficult at the
> > moment. This RFC proposes to pass the calling scope to magic accessors to
> > make it trivial to get it.
>
> Why not a new function, e.g. func_call_scope()? It could work
> everywhere, not only in magic methods.
>
> I guess it would be tricky with calls to the parent magic method when
> you need the "outer calling scope", but I'd like to see some reasoning
> in the RFC.
>
> --
> Aleksander Machniak
> Kolab Groupware Developer [https://kolab.org]
> Roundcube Webmail Developer [https://roundcube.net]
> ----------------------------------------------------
> PGP: 19359DC1 # Blog: https://kolabian.wordpress.com
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: https://www.php.net/unsub.php
>
>