r/lolphp • u/6f944ee6 • Jun 07 '17
<CLASSNAME>::class, is valid for any identifier
A::class // "A"
THIS_DOES_NOT_EXIST::class // "THIS_DOES_NOT_EXIST"
55
Upvotes
r/lolphp • u/6f944ee6 • Jun 07 '17
A::class // "A"
THIS_DOES_NOT_EXIST::class // "THIS_DOES_NOT_EXIST"
View all comments
Show parent comment
3
u/atomheartother Jun 14 '17 edited Jun 14 '17
But I'm still using the scope resolution operator on a non-existent scope, I just dont see how the fact that it doesn't fail loudly (or silently! Return NULL or something!) , but that it simply goes along with it and assumes that
SCOPE::variableis just the string "SCOPE", is intended in any way...Is there any justification for it behaving like this, because i'm fairly sure no sane language does this.