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.
 
 

19 lines
314 B

<?php
function main()
{
global $argv;
$n = $argv[2];
$begin = microtime(true);
echo fib($n) . "\n";
echo "Time: " . (microtime(true) - $begin) . "\n";
}
function fib(int $n): int
{
if ($n == 1 || $n == 2) {
return 1;
} else {
return fib($n - 1) + fib($n - 2);
}
}