title: What does the line "function () use ($app) {" means in the Lumen docs (probably valid in Laravel)
body: <p>I've seen the <code>function () use ($app) {</code> syntax done over and over again in the Lumen docs <a href="https://lumen.laravel.com/docs/5.4/routing" rel="nofollow noreferrer">here</a>.</p>
  
  <p>The full syntax looks like that:</p>
  
  <pre><code>$app-&gt;group(['middleware' =&gt; 'auth'], function () use ($app) {
      $app-&gt;get('/', function ()    {
          // Uses Auth Middleware
      });
  });
  </code></pre>
  
  <p>Is this thing somehow related to the PHP? Lumen? Is it also available in the Laravel?</p>
  
  <p>It looks like the anonymous function in PHP without the curly brackets, however, the <code>use</code> keyword doesn't make sense in the context of this particular code example. As far as I know, using <code>use</code> could be like an alias or the trait in the context of OOP.</p>
  
  <p>Tried changing it a little bit, because I'm not a huge fan of the <code>function ()</code> :D My attempt using <code>function () { use ($app) {</code> results in the syntax error.</p>
  
  <p>I haven't seen anything like that in the PHP before, could you give me some details about it?</p>