Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
function fibonacci($n){
$start = microtime(true);
if ($n < 2){
$f = 1;
}else{
$f = fibonacci($n - 2) + fibonacci($n - 1);
}
return microtime(true) - $start;
}
echo fibonacci(22);
echo "\n";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment