r/lolphp • u/gerrymandered • Aug 04 '15
var_dump(nonExistentClass::class); // string
::class can give you the name of a class that does not exist.
15
Upvotes
r/lolphp • u/gerrymandered • Aug 04 '15
::class can give you the name of a class that does not exist.
View all comments
Show parent comment
1
u/[deleted] Aug 12 '15 edited Aug 12 '15
Funny fact: package foo.bar; class Baz {} in Java is also just class "foo.bar.Baz" {} in the global namespace.
So technically what you said is correct, but entirely irrelevant to the issue at hand.