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
In java you can inspect the call stack. I think you can do the same in php:
debug-backtrace Is this the one you are looking for?
Since php does not optimize recursion with tail calls this should tel you the depth of the recursion.