Php 对象内的访问数组返回非法字符串偏移警告

Php 对象内的访问数组返回非法字符串偏移警告,php,arrays,object,Php,Arrays,Object,这是存储在$book变量中的我的对象的一部分 stdClass (object) [Object ID #59][3 properties] discurso_trecho_candidato: stdClass (object) [Object ID #58][24 properties] ... discurso_trecho_tema: (array) [2 elements]

这是存储在
$book
变量中的我的对象的一部分

stdClass (object) [Object ID #59][3 properties]
    discurso_trecho_candidato: 
        stdClass (object) [Object ID #58][24 properties]
            ...
        discurso_trecho_tema: 
            (array) [2 elements]
                0: 
                stdClass (object) [Object ID #60][10 properties]
                    term_id: (integer) 15 
                    ...
                1: 
                stdClass (object) [Object ID #61][10 properties]
                    term_id: (integer) 13 
                    ...
        discurso_trecho: (string) <p>trcheo sobre desemprego e economia</p>
返回此警告的页面:

警告:警告:在。。。字符串(1)“试试这个

$trecho_temas = $book->discurso_trecho_candidato->discurso_trecho_tema;

因此,
$trecho\u temas
应该有数组。

此返回通知:尝试获取非对象$book represente discurso\u trecho\u candidateto object的属性当我们访问任何需要使用箭头的对象时->请按使用箭头检查:p@Sourabh
discurso\u trecho\u tema
是一个数组。
$trecho_temas = $book->discurso_trecho_candidato->discurso_trecho_tema;