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.
 
 

15 lines
424 B

<?php
function makeAppendValue(int $value): int { return $value + 1; }
function main(int $argc, array $argv): void
{
$rounds = $argc > 1 ? (int) $argv[1] : 10000;
$checksum = 0;
for ($r = 0; $r < $rounds; ++$r) {
$items = [];
for ($i = 0; $i < 1000; ++$i) {
$items[] = makeAppendValue($i);
}
$checksum += count($items) + $items[999];
}
echo $checksum, "\n";
}