Skip to content

Instantly share code, notes, and snippets.

@woprrr
Created August 14, 2018 09:21
Show Gist options
  • Save woprrr/02ee8ad5af83833e05106d1839259a64 to your computer and use it in GitHub Desktop.
Save woprrr/02ee8ad5af83833e05106d1839259a64 to your computer and use it in GitHub Desktop.
<?php
$first = 0;
$second = 1;
$current = 1;
$tableau = [];
$nbToFound = 51;
for ($i = 0; $i <= $nbToFound; $i++) {
$tableau[] = $current;
$current = $first + $second;
$first = $second;
$second = $current;
}
var_dump($tableau[$nbToFound]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment