title: I can't understand how php evaluates this code
body: <p>I came across this part of code somewhere and I don’t understand how both operations evaluate to 3</p>
  
  <pre><code>&lt;?php
  $x = 1;
  $y = $x + $x++;
  var_dump($y); // output : 3
  
  $x = 1;
  $y = $x + $x + $x++;
  var_dump($y); // output : 3
  </code></pre>
  
  <p>what's going on? what am I missing?</p>