[php-src] master: Merge branch 'PHP-8.5' into PHP-8.6

From: Date: Mon, 09 Nov 2026 17:45:12 +0000
Subject: [php-src] master: Merge branch 'PHP-8.5' into PHP-8.6
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-143492@lists.php.net to get a copy of this message
Author: ndossche (ndossche) Date: 2026-11-09T18:44:08+01:00 Commit: https://github.com/php/php-src/commit/59c956f3ed7de8ffc92d13971ac3a507d7c27e13 Raw diff: https://github.com/php/php-src/commit/59c956f3ed7de8ffc92d13971ac3a507d7c27e13.diff Merge branch 'PHP-8.5' into PHP-8.6 * PHP-8.5: Reflection: Fix trampoline leak when object construction fails for lazy object Changed paths: A ext/reflection/tests/ReflectionClass_makeLazyGhost_no_trampoline_leak.phpt M NEWS M ext/reflection/php_reflection.c Diff: diff --git a/NEWS b/NEWS index 1de6cd34aaac..5324e665a764 100644 --- a/NEWS +++ b/NEWS @@ -76,6 +76,8 @@ PHP NEWS - Reflection: . Fixed bug GH-25266 (Misaligned read in ReflectionProperty::isReadable()). (Lazizbek Ergashev) + . Fix trampoline leak when object construction fails for lazy object. + (ndossche) - Streams: . Fixed in-place URL decoding of interned strings in the HTTP and FTP diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 1b9dfd08a2cf..66fe0ec52f05 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -5149,6 +5149,7 @@ void reflection_class_new_lazy(INTERNAL_FUNCTION_PARAMETERS, strategy | options); if (!obj) { + zend_release_fcall_info_cache(&fcc); RETURN_THROWS(); } diff --git a/ext/reflection/tests/ReflectionClass_makeLazyGhost_no_trampoline_leak.phpt b/ext/reflection/tests/ReflectionClass_makeLazyGhost_no_trampoline_leak.phpt new file mode 100644 index 000000000000..dee9b56e5cdd --- /dev/null +++ b/ext/reflection/tests/ReflectionClass_makeLazyGhost_no_trampoline_leak.phpt @@ -0,0 +1,16 @@ +--TEST-- +ReflectionClass::makeLazyGhost() no trampoline leak +--FILE-- +<?php +class Helper { + public function __call($name, $args) {} +} + +try { + (new ReflectionClass('ReflectionClass'))->newLazyGhost([new Helper, 'foo']); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} +?> +--EXPECT-- +Cannot make instance of internal class lazy: ReflectionClass is internal

« previous php.cvs (#143492) next »