title: PHP Function as a Function's Default Parameter
body: <p>I was wondering if there is a simpler way that I can use a php inbuilt function as the default value for a function.</p>
  
  <p>Here's my current code:</p>
  
  <pre><code>function custom_date($format = 'm-d-Y', $time = null)
  {
      if($format == "d-m-Y") {
          // do something with $time
      }
      return date($format, $time);
  }
  </code></pre>
  
  <p>I want to use <code>time()</code> as a default argument for <code>$time</code> instead of <code>null</code>, but it will not let me. I know I can pass <code>time()</code> as a 2nd argument to <code>custom_date</code> everywhere its called, but it's used at many places without 2nd argument and changing it would be a pain.</p>