So the entrypoint file in the Symfony 6 framework (public/index.php
) has a construct which I don't understand.
Below is the whole content of the file:
<?php
use App\Kernel;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
What I don't understand is the usage of the anonymous function. As we are at the very top level I don't know how it is executed and where does it return it's result.