Can anyone explain to me what is actually going on in the function?
function f($b=0)
{
echo $b.',';
/*otuput is 0,1,2,3,4,5,3,4,2,3,4,5,3,*/
if ($b<3)
{
/*echo $b.',';
when echo is here, otuput is 0,1,2,2,*/
for ($a=0;$a<3;$a++)
{
/*echo $b.',';
when echo is here, otuput is 0,1,2,3,4,2,3,1,2,3,4,2,*/
f(++$b);
}
}
}
f();
Why is output not 0,1,2,0,1,2,0,1,2,
?
And how to do with the calling same function from function?