Can anyone explain why is the get_class
function returning different values below? Specifically, what is it supposed to do when it is called in a base class and when it is called in a derived class?
abstract class bar {
public function __construct()
{
var_dump(get_class($this)); //prints 'foo'
var_dump(get_class()); // prints 'bar'
}
}
class foo extends bar {
}
new foo;