From d51efd97352c287bd9c8082700e046ef66f6fa2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Sun, 28 Sep 2025 14:35:49 +0200 Subject: [PATCH] fix: Do not try to create lazy ghosts for PHP internal classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/AppFramework/Utility/SimpleContainer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/AppFramework/Utility/SimpleContainer.php b/lib/private/AppFramework/Utility/SimpleContainer.php index 0db3bfc1c77b6..49decf471f2bf 100644 --- a/lib/private/AppFramework/Utility/SimpleContainer.php +++ b/lib/private/AppFramework/Utility/SimpleContainer.php @@ -61,7 +61,7 @@ private function buildClass(ReflectionClass $class): object { /* No constructor, return a instance directly */ return $class->newInstance(); } - if (PHP_VERSION_ID >= 80400 && self::$useLazyObjects) { + if (PHP_VERSION_ID >= 80400 && self::$useLazyObjects && !$class->isInternal()) { /* For PHP>=8.4, use a lazy ghost to delay constructor and dependency resolving */ /** @psalm-suppress UndefinedMethod */ return $class->newLazyGhost(function (object $object) use ($constructor): void {