Re: [RFC] New core autoloading mechanism with support for function autoloading
| From: | Robert Landers | Date: | Mon, 17 Apr 2023 08:21:51 +0000 |
| Subject: | Re: [RFC] New core autoloading mechanism with support for function autoloading | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-120051@lists.php.net to get a copy of this message | ||
Hello,
This looks really interesting but it might be a good idea to add a
section for the definition of "pinning" and the scope of the pin. For
example, what is the output of this code, executed in this order (with
this new autoloading configured):
// Test.php
namespace Test {
function password_verify(string $password, string $hash): bool {
return true; }
}
// another file
echo Test\password_verify('password', 'hash');
echo password_verify('password', 'hash');
// yet another file
echo password_verify('password', 'hash');
Does this get pinned in the global namespace and does this pin extend
to other files? If so, this could lead to very hard-to-reason-about
code.
Cheers,
Rob Landers
Utrecht, Netherlands