Re: Is there an RFC/discussion for ::class being a specific type?
| From: | Dusk | Date: | Tue, 16 Nov 2021 21:18:51 +0000 |
| Subject: | Re: Is there an RFC/discussion for ::class being a specific type? | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-116425@lists.php.net to get a copy of this message | ||
On Nov 16, 2021, at 10:56, Kamil Tekiela <tekiela246@gmail.com> wrote:
> Ok, but a popular usage is also with functions. For example, strlen::class.
> What should the compiler use in this case?
Popular in what context?
I'm not sure this usage is even correct. strlen::class isn't the name of the strlen
function; it's the name of the class that you'd be instantiating with "new
strlen()", which would be relative to the current namespace. If your code is running in the
root namespace, this will happen to resolve to "strlen", but that doesn't mean
it's returning a callable.