class test {
function test() {
echo "Constructor: class test Constructor <br />";
}
}
class child1 extends test {
function child1() {
echo "Constructor: class child1 parent: " . get_parent_class($this) . "<br />";
}
}
$obj = new test();
if (is_a($obj, 'test'))
echo "\$obj is class test<br />";
$c1 = new child1();
if (is_a($obj, 'test'))
echo "\$obj parent is class test<br />";
/*
run:
Constructor: class test Constructor
$obj is class test
Constructor: class child1 parent: test
$obj parent is class test
*/