我試圖訪問該對象的AA性能date屬性:嘗試訪問DateTime對象檢索
object(DateTime)#321 (3) {
["date"]=>
string(26) "2016-08-02 12:45:01.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
string(13) "Europe/London"
}
我已經試過這樣:
$boo = aboveObject;
$boo->date;
我得到這個錯誤:
"Notice: Undefined property: DateTime::$date"
我也試過這個:
$foo = aboveObject;
$foo['date']
我得到這個錯誤:
"Error: Cannot use object of type DateTime as array"
當然
第二個錯誤更有意義,我鑽了第一種方式我想應該是工作...?任何想法是怎麼回事?