title: Variable assignment in function call
body: <p>I inherited a php codebase that contains some variable assignments in function calls:</p>
  
  <pre><code>&lt;?php
  function some_func($foo, $state) {
    ....
  }
  
  some_func("random stuff", $state = true);
  ...
  some_func("other stuff", $state = false);
  ...
  ?&gt;
  </code></pre>
  
  <p>I did some research and some tests, but I can't find out what the defined behaviour for this code is in PHP. </p>
  
  <p>How is the value of the second argument to <code>some_func()</code> computed? The content of the 4state variable (true on first call, false on second)? Or is it the outcome of the assignment (i.e. assigning <code>true</code>/<code>false</code> to the variable <code>$state</code> was successful, so <code>some_func</code> received <code>true</code>?</p>
  
  <p>What is the value of the <code>$state</code> variable in the global scope? The result of the assignment, i.e. true after the first call, false after the second?</p>