function fibonacci($item) {
$a = 0;
$b = 1;
for ($i = 0; $i < $item; $i++) {
yield $a;
$a = $b - $a;
$b = $a + $b;
}
}
Last active
April 22, 2021 03:00
-
-
Save mitoop/d880e1158f49d1d2326b576c24d4120e to your computer and use it in GitHub Desktop.
fibonacci
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment