为什么is_array()返回false?

dor*_*emi 6 php arrays oop simplexml

我有这个SimpleXML对象:

object(SimpleXMLElement)#176 (1) {
 ["record"]=>
 array(2) {
  [0]=>
  object(SimpleXMLElement)#39 (2) {
     ["f"]=>
     array(2) {
       [0]=>
       string(13) "stuff"
       [1]=>
       string(1) "1"
     }
  }
  [1]=>
  object(SimpleXMLElement)#37 (2) {
    ["f"]=>
    array(2) {
      [0]=>
      string(13) "more stuff"
      [1]=>
      string(3) "90"
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

为什么is_array($ object-> record)返回false?它清楚地说它是一个阵列.为什么我不能使用is_array检测它?

此外,我无法使用(数组)$ object-> record将其强制转换为数组.我收到此错误:

警告:尚无法为属性分配复杂类型

bco*_*sca 5

SimpleXML节点是可以包含其他SimpleXML节点的对象.使用iterator_to_array().