0
我有一個依賴其他對象的對象實例,在PHP中獲取對象相關性
$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'));
如何獲得$objectC
中使用的類的列表?
在這種特殊情況下:
array(
'Some_Class',
'Other_Class',
'Another_Class',
'stdClass',
'Another_Object'
)
我需要序列化對象,但反序列化之前,我需要實例所有需要的類。
你會如何自動獲得課程?