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?
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?
Looking into the SICP book and JS functional programming I created two recursive functions. My expectation was that both of them raised a stack overflow error.
But it is only the sumAll() function that raised the error. See below the code for both functions sumAll() and factorial():
I have the following piece of code which fails with the following error: