Created
October 14, 2015 00:21
-
-
Save karlmonson/dd8df4c4c895e3dd47fe to your computer and use it in GitHub Desktop.
This file contains 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 | |
/* | |
* Fibonacci Example | |
* Author: Karl Monson | |
* URL: https://github.com/karlmonson | |
*/ | |
function fibonacci($num) { | |
if($num == 0) return 0; | |
if($num == 1) return 1; | |
return fibonacci($num - 1) + fibonacci($num - 2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment