Can you explain the difference between get_class($instance)
and ClassName::class
?
Classnames aren't case sentive in PHP.
It seems like get_class($obj)
returns true classname (in PHP core) and ::class
returns the classname used in user's code.
// From PHP Team : The '::class' construct is done purely at compile time, based of the apparent classname passed in. It does not check the spelling of the actual class name, or even that the class exist