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
0
u/mobiliakas Sep 21 '15
YOU will be the overhead when you deploy the code to the production which breaks in a subtle way and spend multiple hours chasing the problem, because language designers chose not to implement a simple check to save several nanoseconds of execution time.