title: PHP - How to catch a 'Trying to get property of non-object' error
body: <p>I am trying to catch 'Trying to get property of non-object' error with a try/catch statement but it is failing, I still get a PHP error. I am using as:</p>
  
  <pre><code>try{
    $id = Model()-&gt;find('id=1')-&gt;id;
  }catch(Exception $e){
    echo 'failed';
  }
  </code></pre>
  
  <p>My find function returns an object (Active Record) and I can access the id column as shown via object prop.</p>
  
  <p>However, it will be null object if AR is not found. I thought the try statement would catch this. A work around for myself would be to use an isset(). But I am confused as to why the try statement does not accept and catch this error.</p>