<?php
class Parent{
}
class Child extends Parent{
}
$c = new Child();
echo get_class($c) //Child
?>
<?php
class Parent{
public function getClass(){
echo get_class();
}
}
class Child extends Parent{
}
$obj = new Child();
$obj->getClass(); //outputs Parent
?>
<?php
class Parent{
public function getClass(){
echo get_class($this);
}
}
class Child extends Parent{
}
$obj = new Child();
$obj->getClass(); // Parent
?>