Classnames are not case sensitive in PHP.
It seems that get_class($obj) returns true classname (in the core of PHP), and ::class returns the class name used in the user code.
<?php // PHP 5.5 var_dump(get_class(new DaTeTImE())); // string(8) "DateTime" var_dump(DaTeTImE::class); // string(8) "DaTeTImE"
// From a PHP command: The ":: class" construct is executed exclusively at compile time, based on the seemingly passed class. It does not check the spelling of the actual class name or even that the class exists
<?php echo dAtEtImE::class; // Output is "dAtEtImE" echo ThisDoesNotExist::class; // Output is "ThisDoesNotExist"
source share