TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

23 lines
544 B

--TEST--
Array element compound arithmetic promotes overflowing integers to float
--FILE--
<?php
declare(strict_types=1);
function main(): void
{
$maximum = PHP_INT_MAX;
$large = intdiv(PHP_INT_MAX, 2) + 1;
$values = ['add' => $maximum, 'multiply' => $large];
$values['add'] += 1;
$values['multiply'] *= 2;
var_dump($values['add'], $values['multiply']);
echo gettype($values['add']), ',', gettype($values['multiply']), "\n";
}
?>
--EXPECT--
float(9.223372036854776E+18)
float(9.223372036854776E+18)
double,double