A->b->c可能存在但是c可能不存在。我该如何检查?
A->b->c
c
将其包装在一个中可能会更好isset()
isset()
if(isset($A->b->c)) { // c exists
这样如果$A or $A->b不存在……它不会爆炸。
$A
$A->b