Fix references handling in convert_scalar_to_number

This commit is contained in:
Nikita Popov 2015-06-16 18:01:11 +02:00
parent 44b7489fef
commit 183c00ddb6
2 changed files with 16 additions and 1 deletions

View File

@ -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:

View 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"