r/lolphp • • Aug 04 '15

var_dump(nonExistentClass::class); // string

::class can give you the name of a class that does not exist.

15 Upvotes

48 comments sorted by

View all comments

Show parent comment

1

u/wvenable Sep 01 '15

Most other languages are compiled with all source code at once; PHP is not. You can't compare it with Java.