Does Tail Recursion will be optimize in php
<p>by this question:
<a href="http://stackoverflow.com/questions/6171807/does-php-optimize-tail-recursion">Does PHP optimize tail recursion?</a></p>

<p>php will not optimize the tail recursion</p>

<p>but i try in my machine, (php 5.3.10)</p>

<p>two programe for fibonacci, one is normal recursion but another is tail recursion</p>

<p>the time which programes used is different a lot:</p>

<p><img src="http://i.stack.imgur.com/k4Ysm.png" alt="enter image description here"></p>

<p>and i feel confused about that, who can tell me why the tail recursion is faster then normal recursion if php does not optimize it？</p>

<p>fibonacci.php:</p>

<pre><code>&lt;?php
function fibonacci($n) {
    if ($n &lt; 2) {
        return $n; 
    }   
    return fibonacci($n - 1) + fibonacci($n - 2); 
}
var_dump(fibonacci(30));
</code></pre>

<p>fibonacci2.php:</p>

<pre><code>&lt;?php
function fibonacci2($n, $acc1, $acc2) {
    if ($n == 0) {
        return $acc1;
    }   
    return fibonacci2($n-1, $acc2, $acc1 + $acc2);
}

var_dump(fibonacci2(30, 0, 1));
</code></pre>
