Re: Class name resolution for \array::class
| From: | Marco Pivetta | Date: | Sun, 30 Sep 2018 23:31:42 +0000 |
| Subject: | Re: Class name resolution for \array::class | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-103291@lists.php.net to get a copy of this message | ||
Since
array is not a class, it doesn't make sense to resolve its type.
What's the use-case for such pseudo-constant in your code?
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/
On Mon, Oct 1, 2018 at 1:30 AM Marcos Passos <marcospassos.com@gmail.com>
wrote:
> Currently, class name resolution supports all types except an array.
> https://3v4l.org/OXFMW
>
> In fact, it is syntactically invalid since the parser fails to recognize
> array::class as an array expression:
>
> Parse error: syntax error, unexpected 'array' (T_ARRAY), expecting
> > identifier (T_STRING)
> > https://3v4l.org/5IOoI
>
>
> Is possible to change the grammar to support array also?
>
> - Marcos
>