It is recommended if you cannot change the logic of the function so that it decreases the number of recursions. However, this solution also relies on performance impact analysis and memory consumption of your application/server/infrastructure.
That is to say, before you take this as the ultimate solution, it would be interesting to reevaluate the code at the points where the exception is launched, if actually already optimized, keep the configuration.
But actually using Laravel I have sometimes come across the need to set this configuration at 500, mainly because of extra packages that generate many features with Xdebug on. However, I use this configuration only in development and testing environment, in production I do not keep Xdebug on, which allows me to maintain the standard for recursions.
Searching the internet for similar solutions I found this: http://stackoverflow.com/questions/8656089/solution-for-fatal-error-maximum-function-nesting-level-of-100-reached-abor. One explanation given is that the Xdebug extension limits the stack to a maximum of 100 pointer stacks. You can increase the amount of stacking or disable in php.ini if you don’t use this extension.
– Don't Panic
But in practice, it means that this request that is giving error, is trying to do what reaches to pass 100?
– Roberta
For each function call, the return address is saved on the stack, when the function gives a Return it goes back to the line that the function was called, picking up from the stack the last stored position. But you must possess a function that is calling it several times and exceeding the maximum size of 100 stored memory addresses. You can use an explanation of how a stack (Stack) works based on the C language: http://www.cprogressivo.net/2014/05/Pilhas-Stack-em-C-O-Que-E-Como-Implementar-Tutorial-C-Estrutura-de-Dados.html Assembly also provides a very good explanation.
– Don't Panic
And the solution I found is recommended?
– Roberta