title: How to use default parameter value in a nested call?
body: <p>I have this situation: function <code>a</code> (a class method, but it's not important, here...) invokes function <code>b</code>.<br>
  Function <code>a</code> has one parameter (say, <code>$p2</code>), with a <em>default</em> value.<br>
  Function <code>b</code> has one parameter (say, <code>$q2</code>), with a <em>default</em> value, too.</p>
  
  <p>If function <code>a</code> is called <strong>without</strong> the parameter <code>$p2</code>, function <code>b</code> should be called <strong>without</strong> the parameter <code>$q2</code>, too, to force it using it's default value.<br>
  If function <code>a</code> is called <strong>with</strong> the parameter <code>$p2</code>, function <code>b</code> should be called <strong>with</strong> the parameter <code>$q2</code>.</p>
  
  <p>To clearify with an example:</p>
  
  <pre><code>function a($p1, $p2 = "default value one") {
    if ($p2 === "default value") {
      b($p1);
    } else {
      b($p1, $p2);
    }
  }
  
  function b(q1, q2 = "default value two") {
    ...
  }
  </code></pre>
  
  <p>Of course it's possible to use a test, as in the example above, but it looks me a really ugly solution... The question is:</p>
  
  <p>Is there a better (faster, cleaner, smarter) code to implement this use case?</p>