Maximum function nesting level of '100'

1

I'm getting the following error in Laravel (when retrieving a password):

  

Maximum function nesting level of '100' reached, aborting!

The solution I found was to add this line in autoload.php

ini_set('xdebug.max_nesting_level', 500);

And it all worked.

But my question is, what is it and why do I need to change it?

Why does it generate this error?

Thank you

    
asked by anonymous 09.05.2017 / 13:58

1 answer

1

This is recommended if you can not change the function logic so that it decreases the amount of recursion. However, this solution also depends on the performance and memory impact analysis of your application / server / infrastructure.

That is to say, before you take this as the definitive solution, it would be interesting to re-evaluate the code at the points where the exception is thrown, if it is already optimized, keep the configuration.

But really, using Laravel a few times I came across the need to set this setting to 500, mainly because of extra packages that generate many features with xdebug turned on. However, I use this configuration only in development and test environment, in production I do not keep xdebug on, which allows me to keep the pattern for recursions.

    
30.05.2017 / 14:01