I guess what you're trying to do is keep track of objects that are running? Not exactly sure what your end goal is here.
Perhaps you're looking for the ReflectionClass at run time? You can determine if a class exists and what the extended class is.
It also sounds like what you're aiming for is an object factory that keeps track of objects that are being used. Look up singletons, factory, and static member functions/variables concepts for those.
As for this:
class A
{
public function __construct()
{ print "A has been called";
}
}
if class B overrides the constructor, it's not going to call A's constructor. Ex:
class B extends A
{
public function __construct()
{ print "B has been called";
// parent::__construct(); /// would print out A has been called
}
}
However in code, you can check if B is an instance of A one of many ways:
function doSomethingWithA(A $a)....
function doSmoethingWithA($a)
{
if($a instanceof A)
{
// blah
}
}
Don't know if that helps much.