title: Using Default Arguments in a Function
body: <p>I am confused about default values for PHP functions. Say I have a function like this:</p>
  
  <pre><code>function foo($blah, $x = "some value", $y = "some other value") {
      // code here!
  }
  </code></pre>
  
  <p>What if I want to use the default argument for $x and set a different argument for $y? </p>
  
  <p>I have been experimenting with different ways and I am just getting more confused. For example, I tried these two:</p>
  
  <pre><code>foo("blah", null, "test");
  foo("blah", "", "test");
  </code></pre>
  
  <p>But both of those do not result in a proper default argument for $x. I have also tried to set it by variable name.</p>
  
  <pre><code>foo("blah", $x, $y = "test");   
  </code></pre>
  
  <p>I fully expected something like this to work. But it doesn't work as I expected at all. It seems like no matter what I do, I am going to have to end up typing in the default arguments anyway, every time I invoke the function. And I must be missing something obvious. </p>