title: Check if an object is null (Shortest way)
body: <p><br/>
  I try to check if an object is null.<br/>
  In <b>Groovy</b> I can check:</p>
  
  <pre><code>System.out.println(object?.object2?.property)
  </code></pre>
  
  <p>In other words</p>
  
  <pre><code>if(object != null){
      if(object.object2 != null){
          System.out.println(object.object2.property);
      }
  }
  </code></pre>
  
  <p>Now I want the same in PHP<br/>
  How can I write the same in the shortest way?</p>
  
  <pre><code>object-&gt;object2-&gt;property
  </code></pre>
  
  <p>object2 can be null<br/>
  if I try to get the property of object2 I get a NPE</p>
  
  <p>Thanks for help.</p>