title: Correct way to handle PHP 7 return types
body: <p>I'm busy creating an application and i want to use the PHP 7 return types. Now I read on php.net that it was a design decision that it is not allowed to return <code>null</code> when a return type is defined.</p>
  
  <p>What is the correct way too handle this?</p>
  
  <p>One option is a try...catch block:</p>
  
  <pre><code>public function getMyObject() : MyObject
  { 
       return null;
  }
  
  try
  {
      getMyObject();
  }
  catch(Exception $e)
  {
      //Catch the exception
  }
  </code></pre>
  
  <p>I don't have a good feeling about this, because my code will be a huge try...catch block since I need to write a try...catch block for every method that returns an object.</p>
  
  <p>The <a href="https://en.wikipedia.org/wiki/Null_Object_pattern">Null Object Pattern</a> is a good solution for this, but I don't like the idea to create a <code>NullObject</code> for each object in my application. 
  Is there correct way to do this? </p>