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.
22 lines
323 B
22 lines
323 B
--TEST--
|
|
Loop var optimizer: descending for counter with typed int function init
|
|
--FILE--
|
|
<?php
|
|
function start_value(): int {
|
|
return 4;
|
|
}
|
|
|
|
function main(): void {
|
|
$sum = 0;
|
|
|
|
for ($i = start_value(); $i > 0; $i--) {
|
|
$sum += $i;
|
|
}
|
|
|
|
var_dump($i);
|
|
var_dump($sum);
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
int(0)
|
|
int(10)
|
|
|