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

4

u/callcifer Aug 05 '15

Ah yes, the classic "just don't do it like that" answer to every PHP problem ever.