title: Problem in understanding datetime difference and invert
body: <p>I am having a problem in understanding the difference between datetime. I am using PHP datetime class.</p>
  
  <p>Here is a small part of my code to calculate the datetime difference:</p>
  
  <pre><code>date_default_timezone_set("Asia/Kolkata");
  
  function timeline_date($date)
  {
      $today = new DateTime();
      $timeline_date = new DateTime($date);
      $interval = $today-&gt;diff($timeline_date);
  
      echo "&lt;pre&gt;";
      print_r($today);
      print_r($timeline_date);
      print_r($interval);
      echo "&lt;/pre&gt;";
  }
  $date = "2019-02-02 04:36:02";
  echo timeline_date($date);
  </code></pre>
  
  <p>What is the meaning of statement:</p>
  
  <pre><code>$interval = $today-&gt;diff($timeline_date);
  </code></pre>
  
  <p>Is it subtracting $timeline_date from $today?</p>
  
  <p>Or is it subtracting $today from $timeline_date?</p>
  
  <p>I am having a great confusion regarding this particular statement. I searched on Internet but nothing is clearly mentioned on it.</p>
  
  <p>Also $timeline_date can be past or future date and even today's date. So does it matter we should subtract small quantity from large quantity?</p>
  
  <p>I get following output from above code:</p>
  
  <pre><code>DateTime Object
  (
      [date] =&gt; 2019-02-05 16:11:37
      [timezone_type] =&gt; 3
      [timezone] =&gt; Asia/Kolkata
  )
  DateTime Object
  (
      [date] =&gt; 2019-02-02 04:36:02
      [timezone_type] =&gt; 3
      [timezone] =&gt; Asia/Kolkata
  )
  DateInterval Object
  (
      [y] =&gt; 0
      [m] =&gt; 0
      [d] =&gt; 3
      [h] =&gt; 11
      [i] =&gt; 35
      [s] =&gt; 35
      [weekday] =&gt; 0
      [weekday_behavior] =&gt; 0
      [first_last_day_of] =&gt; 0
      [invert] =&gt; 1
      [days] =&gt; 3
      [special_type] =&gt; 0
      [special_amount] =&gt; 0
      [have_weekday_relative] =&gt; 0
      [have_special_relative] =&gt; 0
  )
  </code></pre>
  
  <p>We can see <code>[invert] =&gt; 1</code> in above array. What is actual meaning of it? If I change the $date to:</p>
  
  <pre><code>$date = "2019-02-10 04:36:02";
  </code></pre>
  
  <p>Then <code>[invert] =&gt; 0</code> changes to 1. Why? Does it mean if we have past date in difference then invert will be 0 and if we have future date then this array element will be 1?</p>