title: Does PHP have lexical scope in anonymous functions / closures?
body: <p>I'm using PHP 5.4 and wondering if the anonymous functions I'm making have lexical scoping? </p>
  
  <p>I.e. If I have a controller method:</p>
  
  <pre><code>protected function _pre() {
      $this-&gt;require = new Access_Factory(function($url) {
          $this-&gt;redirect($url);
      });
  }
  </code></pre>
  
  <p>When the Access Factory calls the function it was passed, will the $this refer to the Controller where it was defined?</p>