这个
if(is_object($value)) echo 'AAA';
if(gettype($value)==='object') echo 'BBB'
打印“BBB”。
具体来说,值是 __PHP_Incomplete_Class Object
,它是 unserialize
的结果。为什么 is_object
会返回 false?
最佳答案
Note:
This function will return FALSE if used on an unserialized object where the class definition is not present (even though gettype() returns object).
关于php - 这个对象怎么可能是对象而不是对象呢?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6048189/