Created
June 19, 2012 09:15
-
-
Save torus/2953169 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
| echo call_user_func(call_user_func(function ($func) { | |
| return call_user_func(function ($f) use ($func) { | |
| return call_user_func(function ($g) use ($f) { | |
| return function ($n) use ($f, $g) { | |
| return call_user_func($g($f($f)), $n); | |
| }; | |
| }, $func); | |
| }, function ($f) use ($func) { | |
| return call_user_func(function ($g) use ($f) { | |
| return function ($n) use ($f, $g) { | |
| return call_user_func($g($f($f)), $n); | |
| }; | |
| }, $func); | |
| });}, | |
| function ($h) { /* Fibonacci */ | |
| return function ($n) use ($h) { | |
| return ($n <= 2) ? 1 : ($h($n - 2) + $h($n - 1)); | |
| }; | |
| }), 10); | |
| echo "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment