mirror of
https://github.com/php/php-src.git
synced 2024-12-17 05:50:14 +08:00
Fix references handling in convert_scalar_to_number
This commit is contained in:
parent
44b7489fef
commit
183c00ddb6
@ -144,7 +144,7 @@ try_again:
|
||||
ZVAL_UNREF(op);
|
||||
} else {
|
||||
Z_DELREF_P(op);
|
||||
ZVAL_COPY_VALUE(op, Z_REFVAL_P(op));
|
||||
ZVAL_COPY(op, Z_REFVAL_P(op));
|
||||
}
|
||||
goto try_again;
|
||||
case IS_STRING:
|
||||
|
15
ext/standard/tests/array/array_sum_on_reference.phpt
Normal file
15
ext/standard/tests/array/array_sum_on_reference.phpt
Normal file
@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
array_sum() on array with references
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$n = "10";
|
||||
$n .= "0";
|
||||
$nums = [&$n, 100];
|
||||
var_dump(array_sum($nums));
|
||||
var_dump($n);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(200)
|
||||
string(3) "100"
|
Loading…
Reference in New Issue
Block a user