title: DateTime: Syntax error, unexpected T_OBJECT_OPERATOR
body: <p>It works fine on <code>localhost</code>, but when I upload it to my host online it shows this error:</p>
  
  <pre><code>syntax error, unexpected T_OBJECT_OPERATOR
  </code></pre>
  
  <p>How can I fix it? Do I have to define the <code>DateTime</code> function somewhere?</p>
  
  <pre><code>if ((new DateTime($date))-&gt;diff(new DateTime())-&gt;days &gt; 10) { 
      echo 'test';
  }
  </code></pre>
  
  <p>UPDATE:</p>
  
  <pre><code>$date = DateTime::createFromFormat('y-M-d l H:i a', $date);
  if ($date-&gt;diff(new DateTime())-&gt;days &gt; 10) {
  </code></pre>