title: How to define local functions in PHP?
body: <p>When I try to do this:</p>
  
  <pre><code>function a()
  {
      function b() { }
  }
  
  a();
  a();
  </code></pre>
  
  <p>I get <code>Cannot redeclare b...</code>.<br>
  When I tried to do this:</p>
  
  <pre><code>function a()
  {
      if(!isset(b))
          function b() { }
  }
  
  a();
  a();
  </code></pre>
  
  <p>I get <code>unexpected ), expected ...</code>.<br>
  How can I declare the function as local and to be forgotten of when <code>a</code> returns? I need the function to pass it to <code>array_filter</code>.</p>