Skip to content

Instantly share code, notes, and snippets.

@louisje
Created November 9, 2012 04:08
Show Gist options
  • Save louisje/4043654 to your computer and use it in GitHub Desktop.
Save louisje/4043654 to your computer and use it in GitHub Desktop.
var logger = console.log;//<?php function logger($msg) {echo "\n".$msg;};
function fibonacci($seq) {
if ($seq < 2) {
return $seq;
} else {
return fibonacci($seq - 1) + fibonacci($seq - 2);
}
}
logger(fibonacci(10));
/**
* The code above can be both compatible with JS and PHP.
* I think I can write a program compatible both.
*
* @gist https://gist.github.com/4043654
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment