diff options
author | twosee <twose@qq.com> | 2020-07-11 06:14:22 +0800 |
---|---|---|
committer | twosee <twose@qq.com> | 2020-07-11 06:14:22 +0800 |
commit | 150504e6b1ea2b2eac3177c8cff2657a243da22c (patch) | |
tree | 23b9752dcd7b8e06b5874a11b5312634d958fc11 /ext/standard/tests/bug79821.phpt | |
parent | a72c53a0707db617ba0cf55d639bc188c3aa8ede (diff) | |
download | php-git-150504e6b1ea2b2eac3177c8cff2657a243da22c.tar.gz |
Fixed bug #79821
HashTable was reallocated (zend_hash_packed_grow) during php_var_dump, so we should call GC_ADDREF to make SEPARATE_ARRAY work.
Closes GH-5837.
Diffstat (limited to 'ext/standard/tests/bug79821.phpt')
-rw-r--r-- | ext/standard/tests/bug79821.phpt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/standard/tests/bug79821.phpt b/ext/standard/tests/bug79821.phpt new file mode 100644 index 0000000000..cf1d27e128 --- /dev/null +++ b/ext/standard/tests/bug79821.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #79821 (array grow during var_dump) +--FILE-- +<?php + +$foo = $bar = []; +for ($i = 0; $i < 3; $i++) { + $foo = [$foo, [&$bar]]; +} +ob_start(function (string $buffer) use (&$bar) { + $bar[][] = null; + return ''; +}, 1); +var_dump($foo[0]); +ob_end_clean(); + +echo "OK\n"; + +?> +--EXPECT-- +OK |