PHP code example of sharkzt / fibonacci

1. Go to this page and download the library: Download sharkzt/fibonacci library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sharkzt / fibonacci example snippets

 php
//get fibonacci series via class with recursion approach
$fibonacciWithRecursion = new \Sharkzt\Fibonacci\Singleton\Fibonacci(11);
return $fibonacciWithRecursion->getSeries();

//get fibonacci series via class with iteration approach 
$fibonacciWithIteration = new \Sharkzt\Fibonacci\Singleton\FibonacciIterator(11);
$fibonacciWithIteration->initialize();
return $fibonacciWithIteration->getSeries();