I have an instance of the object which is dependent on other objects, e.g.
$objA = new Some_Class();
$objB = new Other_Class();
$objC = new Another_One();
$objA->property = new stdClass;
$objB->key = $objA;
$objB->arr = array(new Other_Object());
$objectC->property = $objB
$objectC->other = array(array('k'=>'v'));
How can I get a list of classes used in $objectC
?
In this particular case:
array(
'Some_Class',
'Other_Class',
'Another_Class',
'stdClass',
'Another_Object'
)
I need to serialize the object, but before unserializing I need to instantiate all the needed classes.
How would you get the classes automatically?