How to get current recursion level in a PHP function ? I mean, is there any \"magical\" (or eventually normal) function like this :
function doSomething($thi
You need to count it yourself, the only alternative would be something like XDebug which profiles your complete software. But this is highly inefficient.
$v) {
}
}
else {
echo $counter;
--$counter;
// If we're returning (only PHP 5.5+)
try {
return $counter;
}
finally {
--$counter;
}
}
}
?>
This allows you to count without a second public parameter.