title: php datetime diff error parameter1 considered as null
body: <p>I want to get the difference (dateInterval) between 2 dateTime.
  Those 2 dateTimes come from a table of my mysql database, which contains 2 columns, which are varchar strings, because of json format, example :</p>
  
  <pre><code>{"name":"firstdate","date":"2016-06-06 23:42:35","id":"1"}
  </code></pre>
  
  <p>but those columns can be null.</p>
  
  <p>So I've an array which store those 2 columns, as exemple :</p>
  
  <pre><code>$array[0] and $array[1] which may contains null or the json
  </code></pre>
  
  <p>in a script I check if the content of the $array[$i] is null or not, if it's not null, I use json_decode, true on the $array[$i].</p>
  
  <p>Then with</p>
  
  <pre><code>$dateNow = new DateTime("now", new dateTimeZone('Europe/Paris'));
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$array[$i]['date'] = new DateTime($jsonDecoded['date'], new dateTimeZone('Europe/Paris'));
  </code></pre>
  
  <p>I do :</p>
  
  <pre><code>if($dateNow &lt; $array[$i]['date'])
  {
      $diffDate = $array[$i]['date']-&gt;diff($dateNow);
  }
  </code></pre>
  
  <p>I get this error :</p>
  
  <pre><code>PHP message: PHP Warning:  DateTime::diff() expects parameter 1 to be DateTimeInterface, null given 
  </code></pre>
  
  <p>By the way I've checked with a var_dump the content of $array[$i]['date'] and it's not null, it contains the date in the right format.
  Moreover, even if I write a date by myself instead of using the json decoded, it still returns the same error...</p>