Not just that, but `debug_backtrace()` already exists for that purpose. On Thu, 19 Jan 2023, 19:23 Aleksander Machniak, <a...@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 > >