Commit c569f514887 for php.net
commit c569f514887e880403fb3457a6cb191289e94d79
Merge: 1da41afdf30 75217c16c89
Author: Alexandre Daubois <alex.daubois@gmail.com>
Date: Tue Sep 16 15:10:23 2025 +0200
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
Fix GH-19801: address leak when calling var_dump() with recursion in __debugInfo() (#19837)
diff --cc ext/standard/tests/general_functions/debug_zval_dump_gh19801_memory_leak.phpt
index 00000000000,8d65cd6d185..cf2f1d444f1
mode 000000,100644..100644
--- a/ext/standard/tests/general_functions/debug_zval_dump_gh19801_memory_leak.phpt
+++ b/ext/standard/tests/general_functions/debug_zval_dump_gh19801_memory_leak.phpt
@@@ -1,0 -1,32 +1,32 @@@
+ --TEST--
+ GH-19801 (debug_zval_dump() leak with __debugInfo() that modifies circular references)
+ --FILE--
+ <?php
+
+ $a = [
+ new class {
+ function __debugInfo() {
+ global $b;
+ $b->a = null;
+ gc_collect_cycles();
+ return [];
+ }
+ },
+ ];
+
+ $b = new stdClass;
+ $b->a = &$a;
+
+ debug_zval_dump($b);
+ ?>
+ --EXPECTF--
+ object(stdClass)#2 (1) refcount(%d){
+ ["a"]=>
+ reference refcount(%d) {
- array(1) refcount(%d){
++ array(1) packed refcount(%d){
+ [0]=>
+ object(class@anonymous)#1 (0) refcount(%d){
+ }
+ }
+ }
+ }