Created
January 13, 2012 03:55
-
-
Save haileys/1604604 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function fib($n) { | |
if($n <= 2) { | |
return 1; | |
} else { | |
return fib($n - 1) + fib($n - 2); | |
} | |
} | |
echo fib(30) . "\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if(!isset($_)) $_ = array(); | |
function fib($n) { | |
$_ = array(); | |
array_push($_, $n); | |
array_push($_, 2); | |
$__Y2ZjZDI = array_pop($_); | |
array_push($_, array_pop($_) <= $__Y2ZjZDI); | |
if(array_pop($_)) { | |
array_push($_, 1); | |
return array_pop($_); | |
} else { | |
array_push($_, 'fib'); | |
$__YzRjYTQ = array_pop($_); | |
array_push($_, $n); | |
array_push($_, 1); | |
$__YzgxZTc = array_pop($_); | |
array_push($_, array_pop($_) - $__YzgxZTc); | |
$__ZWNjYmM = array_pop($_); | |
array_push($_, $__YzRjYTQ($__ZWNjYmM)); | |
array_push($_, 'fib'); | |
$__YTg3ZmY = array_pop($_); | |
array_push($_, $n); | |
array_push($_, 2); | |
$__ZTRkYTN = array_pop($_); | |
array_push($_, array_pop($_) - $__ZTRkYTN); | |
$__MTY3OTA = array_pop($_); | |
array_push($_, $__YTg3ZmY($__MTY3OTA)); | |
$__OGYxNGU = array_pop($_); | |
array_push($_, array_pop($_) + $__OGYxNGU); | |
return array_pop($_); | |
} | |
} | |
array_push($_, 'fib'); | |
$__YzlmMGY = array_pop($_); | |
array_push($_, 30); | |
$__NDVjNDh = array_pop($_); | |
array_push($_, $__YzlmMGY($__NDVjNDh)); | |
array_push($_,' | |
'); | |
$__ZDNkOTQ = array_pop($_); | |
array_push($_, array_pop($_) . $__ZDNkOTQ); | |
echo array_pop($_); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment