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

From: Date: Mon, 09 Nov 2026 17:45:12 +0000
Subject: [php-src] PHP-8.6: Merge branch 'PHP-8.4' into PHP-8.5
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-143493@lists.php.net to get a copy of this message
Author: ndossche (ndossche) Date: 2026-11-09T18:43:48+01:00 Commit: https://github.com/php/php-src/commit/dab8fe3748b4dcebe4ce5c86166ac9aa003f23e6 Raw diff: https://github.com/php/php-src/commit/dab8fe3748b4dcebe4ce5c86166ac9aa003f23e6.diff Merge branch 'PHP-8.4' into PHP-8.5 * PHP-8.4: 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 68b1dcaecf3b..2b420fdc3f04 100644 --- a/NEWS +++ b/NEWS @@ -57,6 +57,10 @@ PHP NEWS . Fixed incorrect handling of non-ASCII pending_input bytes in readline_info(), which could cause readline() to return false prematurely. (Weilin Du) +- Reflection: + . 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 wrappers. (Alejandro Pacheco) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index b799b0347645..76b310217c37 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -5330,6 +5330,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 (#143493) next »