1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 18:53:33 +02:00

Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #79364: When copy empty array, next key is unspecified
This commit is contained in:
Christoph M. Becker
2020-03-11 08:57:17 +01:00
2 changed files with 23 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
--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)
}
+1 -1
View File
@@ -2058,7 +2058,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
target->nTableMask = HT_MIN_MASK;
target->nNumUsed = 0;
target->nNumOfElements = 0;
target->nNextFreeElement = ZEND_LONG_MIN;
target->nNextFreeElement = source->nNextFreeElement;
target->nInternalPointer = 0;
target->nTableSize = HT_MIN_SIZE;
HT_SET_DATA_ADDR(target, &uninitialized_bucket);