title: php Slim framework - passing parameter to closure
body: <p>I am trying to study the code for Slim framework. In the constructor for Slim class, $c is passed to the closure (for instance, when storing/setting the request/response object in the container): </p>
  
  <pre><code> public function __construct(array $userSettings = array())
      {
          // Setup IoC container
          $this-&gt;container = new \Slim\Helper\Set();
          $this-&gt;container['settings'] = array_merge(static::getDefaultSettings(), $userSettings);
  
          // Default request
          $this-&gt;container-&gt;singleton('request', function ($c) {
            return new \Slim\Http\Request($c['environment']);
          });
  
          // Default response
          $this-&gt;container-&gt;singleton('response', function ($c) {
            return new \Slim\Http\Response();
          });
  </code></pre>
  
  <p>But $c is not defined/declared anywhere prior to this statement, so how does it work? I started to trace everything from the beginning and I can't find $c anywhere prior to it being used in this manner. </p>