title: DateTime Modify() php affecting previous variable
body: <p>So I'm having a weird issue with DateTimes modify() function.</p>
  
  <p>I start off with a DateTime eg: 2018-08-07 12:00 &amp; a number of days to add eg: 2.</p>
  
  <p>I copy the dateTime (in variable $startDt) to a new variable ($date) so its not affected by any changes.</p>
  
  <p>The modify function works fine. I get 2018-08-09 12:00. But then I want to repeat the action with a new number but the same start date. Say +3.</p>
  
  <p>But it adds a total of 5! I checked and when using modify() on $date; it somehow also changes $startDt.</p>
  
  <p>Can someone explain this miracle to me? :)) How does applying a function to Variable 2 affect Variable 1? Even if Variable 2 was initially a clone of Variable 1; they are supposed to be 2 separate entities...</p>
  
  <pre><code>while ($x &lt; $duration) {
  
          $date = $startDt;
          echo "$startDt before:" . $startDt-&gt;format('Y-m-d') . "&lt;br&gt;";
          $date = $date-&gt;modify('+' . $x . 'day');
          echo "$startDt after:" . $startDt-&gt;format('Y-m-d') . "&lt;br&gt;";
  
          $x++;
  
      }
  </code></pre>
  
  <p>Results:</p>
  
  <pre><code>$startDt before +2 : 2018-08-08
  $startDt after: 2018-08-10
  $startDt before +3 : 2018-08-10
  $startDt after: 2018-08-13
  </code></pre>