Re: [RFC] Pass Scope to Magic Accessors

From: Date: Thu, 19 Jan 2023 18:23:19 +0000
Subject: Re: [RFC] Pass Scope to Magic Accessors
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-119353@lists.php.net to get a copy of this message
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

« previous php.internals (#119353) next »