0

I have to run a function more than 5000 time. I have setted xdebug.max_nesting_level = 10000

but it says problem loading page on firefox.

what is the max limit for xdebug.max_nesting_level and how can I solve this problem.

Please help me, thanks in advance.

TheHanif
  • 43
  • 2
  • 8

2 Answers2

4

max_nesting_level has nothing to do with how many functions you call, but how many nested levels of function calls you have. max_nesting_level protects things like:

function a()
{
    a();
}

a();

Without Xdebug's max_nesting_level, this will make PHP crash because it runs out of stack space.

The max limit for the setting depends on he operating system, but in general anything over 2500 seems to be too high.

In order to make sure Xdebug's max_nesting_level isn't hit during running of your script, you probably need to change how your code works (ie, don't do nesting or recursive function calls). Because I do no know your code, I of course can't say whether you might just have hit a bug in it.

cheers, Derick

Derick
  • 29,998
  • 5
  • 65
  • 88
  • For people from functional programming codes in PHP, they passes functions around in their codes and generally said, 1000 nesting level is quite normal. – Vicary Jan 08 '13 at 07:31
1

Like @Dreick said, your problem is not in the nesting. To track down your problem you have to allow errors display like below, as mentioned in this answer :

display_errors = on
display_startup_errors = on
George Dimitriadis
  • 1,272
  • 1
  • 15
  • 22
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/18040187) – Saqib Omer Nov 23 '17 at 11:31
  • You're right, I update the answer, thanks for the feedback ! – George Dimitriadis Nov 23 '17 at 11:33