php-src/Zend/tests/bug79364.phpt
Christoph M. Becker 2462f2dab1 Fix #79364: When copy empty array, next key is unspecified
We must not forget to keep the `nNextFreeElement` when duplicating
empty arrays.
2020-03-11 08:54:05 +01:00

23 lines
241 B
PHP

--TEST--
Bug #79364 (When copy empty array, next key is unspecified)
--FILE--
<?php
$a = [1, 2];
unset($a[1], $a[0]);
$b = $a;
$a[] = 3;
$b[] = 4;
var_dump($a, $b);
?>
--EXPECT--
array(1) {
[2]=>
int(3)
}
array(1) {
[2]=>
int(4)
}