mirror of
https://github.com/php/php-src.git
synced 2025-01-03 09:23:42 +08:00
Merge branch 'PHP-7.2'
This commit is contained in:
commit
5c983ae852
@ -4049,7 +4049,8 @@ PHP_FUNCTION(array_values)
|
||||
/* Return empty input as is */
|
||||
arrlen = zend_hash_num_elements(arrval);
|
||||
if (!arrlen) {
|
||||
RETURN_ZVAL(input, 1, 0);
|
||||
ZVAL_EMPTY_ARRAY(return_value);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Return vector-like packed arrays as-is */
|
||||
|
20
ext/standard/tests/array/bug75653.phpt
Normal file
20
ext/standard/tests/array/bug75653.phpt
Normal file
@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #75653: array_values don't work on empty array
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$array[] = 'data1';
|
||||
unset($array[0]);
|
||||
$array = array_values($array);
|
||||
$array[] = 'data2';
|
||||
$array[] = 'data3';
|
||||
var_dump($array);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(5) "data2"
|
||||
[1]=>
|
||||
string(5) "data3"
|
||||
}
|
Loading…
Reference in New Issue
Block a user