Skip to content

Commit 2190386

Browse files
[DependencyInjection] Skip preloading on PHP 8.0
1 parent f9a28fe commit 2190386

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,12 @@ public function dump(array $options = [])
308308
require $autoloadFile;
309309
require __DIR__.'/Container{$hash}/{$options['class']}.php';
310310
311+
if (80000 <= \PHP_VERSION_ID && \PHP_VERSION_ID < 80100) {
312+
// Preloading on PHP 8.0 fails with a fatal error when typed properties are used
313+
// if some of those types are referencing optional and non-installed dependencies.
314+
return;
315+
}
316+
311317
\$classes = [];
312318
313319
EOF;

0 commit comments

Comments
 (0)