Array ( [Container%s/removed-ids.php] => true, ]; [Container%s/getClosureService.php] => services['closure'] = $instance = new \stdClass(); $instance->closures = [#[\Closure(name: 'foo', class: 'FooClass')] fn (): ?\stdClass => ($container->services['foo'] ?? null)]; return $instance; } } [Container%s/ProjectServiceContainer.php] => targetDir = \dirname($containerDir); $this->services = $this->privates = []; $this->methodMap = [ 'foo' => 'getFooService', ]; $this->fileMap = [ 'closure' => 'getClosureService', ]; $this->aliases = []; } public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } public function isCompiled(): bool { return true; } public function getRemovedIds(): array { return require $this->containerDir.\DIRECTORY_SEPARATOR.'removed-ids.php'; } protected function load($file, $lazyLoad = true): mixed { if (class_exists($class = __NAMESPACE__.'\\'.$file, false)) { return $class::do($this, $lazyLoad); } if ('.' === $file[-4]) { $class = substr($class, 0, -4); } else { $file .= '.php'; } $service = require $this->containerDir.\DIRECTORY_SEPARATOR.$file; return class_exists($class, false) ? $class::do($this, $lazyLoad) : $service; } /** * Gets the public 'foo' shared service. * * @return \FooClass */ protected static function getFooService($container) { return $container->services['foo'] = new \FooClass(new \stdClass()); } } [ProjectServiceContainer.preload.php] => = 7.4 when preloading is desired use Symfony\Component\DependencyInjection\Dumper\Preloader; if (in_array(PHP_SAPI, ['cli', 'phpdbg'], true)) { return; } require dirname(__DIR__, %d).'%svendor/autoload.php'; (require __DIR__.'/ProjectServiceContainer.php')->set(\Container%s\ProjectServiceContainer::class, null); require __DIR__.'/Container%s/getClosureService.php'; $classes = []; $classes[] = 'FooClass'; $classes[] = 'Symfony\Component\DependencyInjection\ContainerInterface'; $preloaded = Preloader::preload($classes); [ProjectServiceContainer.php] => '%s', 'container.build_id' => '%s', 'container.build_time' => %d, ], __DIR__.\DIRECTORY_SEPARATOR.'Container%s'); )