title: Calling an array using object syntax in PHP
body: <p>I'm getting the error "Trying to get property of non-object" when attempting to call an array using php object syntax.</p>
  
  <pre><code>Yii::log(print_r($terminalReport-&gt;terminal-&gt;started_at,true));
  </code></pre>
  
  <p>That line will actually log the started_at time correctly and then error out.</p>
  
  <p>This code works on a production server. However, this is not working on a recently set up dev environment.</p>
  
  <p>Is there a PHP module I'm missing that will allow me to call an array using that syntax without throwing an error?</p>
  
  <p>Here is the full stack trace:</p>
  
  <pre><code>2015/08/25 13:22:12 [error] [php] Trying to get property of non-object (/PATH/app/protected/models/TerminalReportManager.php:33)
  Stack trace:
  #0 /PATH/framework/yiilite.php(3100): TerminalController-&gt;renderInternal()
  #1 /PATH/framework/yiilite.php(3524): TerminalController-&gt;renderFile()
  #2 /PATH/framework/yiilite.php(3492): TerminalController-&gt;renderPartial()
  #3 /PATH/app/protected/controllers/TerminalController.php(38): TerminalController-&gt;render()
  #4 /PATH/framework/yiilite.php(3760): TerminalController-&gt;actionIndex()
  #5 /PATH/framework/yiilite.php(3272): CInlineAction-&gt;runWithParams()
  #6 /PATH/framework/yiilite.php(6526): TerminalController-&gt;runAction()
  #7 /PATH/framework/yiilite.php(6535): CFilterChain-&gt;run()
  #8 /PATH/app/protected/components/system/Controller.php(60): AccessControlFilter-&gt;filter()
  #9 /PATH/framework/yiilite.php(6568): TerminalController-&gt;filterAccessControl()
  #10 /PATH/framework/yiilite.php(6523): CInlineFilter-&gt;filter()
  #11 /PATH/framework/yiilite.php(3262): CFilterChain-&gt;run()
  #12 /PATH/framework/yiilite.php(3247): TerminalController-&gt;runActionWithFilters()
  #13 /PATH/framework/yiilite.php(1689): TerminalController-&gt;run()
  #14 /PATH/framework/yiilite.php(1609): CWebApplication-&gt;runController()
  #15 /PATH/framework/yiilite.php(1135): CWebApplication-&gt;processRequest()
  #16 /PATH/app/index.php(21): CWebApplication-&gt;run()
  REQUEST_URI=/terminal
  </code></pre>