Rowan, thank you for sharing your thoughts. You can also see it as a language construct that expects a type at the left-hand side of the name resolution operator. In that sense, primitive types are perfectly valid.
Regards, Marcos Em seg, 1 de out de 2018 às 05:45, Rowan Collins <rowan.coll...@gmail.com> escreveu: > On Mon, 1 Oct 2018 at 00:30, Marcos Passos <marcospassos....@gmail.com> > wrote: > >> Currently, class name resolution supports all types except an array. >> https://3v4l.org/OXFMW >> > > It seems to me that the bug is allowing an expression like "int::class" to > resolve, when "int" is no longer a legal class name. > > I suspect the reason "array::class" doesn't work is that it was already a > reserved word in PHP 5, whereas other types were legal class names. In PHP > 5, "int::class" can plausibly resolve to the name of an actual class, but > in PHP 7, it can't, but clearly this part of the grammar wasn't updated to > reflect that. > > The parser is being too forgiving here, I think, and should complain if > the word before :: is not a valid class name. > > Regards, > -- > Rowan Collins > [IMSoP] >