Fibonacci Binet

<?php

/**
 * fibonacci_binet
 *
 * Simple example of Fibonacci series algorithm using Binet
 *
 * @version 0.3
 * @author Contributors at eXorithm
 * @link https://www.exorithm.com/algorithm/view/fibonacci_binet Listing at eXorithm
 * @link https://www.exorithm.com/algorithm/history/fibonacci_binet History at eXorithm
 * @license https://www.exorithm.com/home/show/license
 *
 * @param number $n 
 * @return mixed
 */
function fibonacci_binet($n=13)
{
	$phi = (1 + sqrt(5)) / 2;
	$u = (pow($phi, $n) - pow(1 - $phi, $n)) / sqrt(5);
	return $u;
}

?>