Does PHP optimize tail recursion?
I wrote a small piece of code that I believe should have succeeded if tail recursion was optimized, however it blew up the stack. Should I conclude PHP does not optimize tail recursion?

    function sumrand($n,$sum) {
    	if ($n== 0) {
    		return $sum;
    	}
    	else {
    		return (sumrand($n-1,$sum+rand(0,1)));
    	}
    }
    echo sumrand(500000,0)."\n";

Does PHP optimize tail recursion?
===

I wrote a small piece of code that I believe should have succeeded if tail recursion was optimized, however it blew up the stack. Should I conclude PHP does not optimize tail recursion?

    function sumrand($n,$sum) {
    	if ($n== 0) {
    		return $sum;
    	}
    	else {
    		return (sumrand($n-1,$sum+rand(0,1)));
    	}
    }
    echo sumrand(500000,0)."\n";
