mirror of
https://github.com/php/php-src.git
synced 2024-12-18 14:30:35 +08:00
2462f2dab1
We must not forget to keep the `nNextFreeElement` when duplicating empty arrays.
23 lines
241 B
PHP
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)
|
|
}
|