I see a practice used in several frameworks in recent times. It consists of registering the objects in the container with the class constant instead of a string. Usually the objects are added following example below.
$container[MyClass::name] = function(){
// create object here
}
I usually use a string:
$container['MyClass'] = function(){
// create object here
}
I would like to know the facilities of this practice.