Solution for “Fatal error: Maximum function nesting level of '100' reached, aborting!” in PHP

后端 未结 22 2387
我寻月下人不归
我寻月下人不归 2020-11-22 16:45

I have made a function that finds all the URLs within an html file and repeats the same process for each html content linked to the discovered URLs. The function is recursiv

22条回答
  •  误落风尘
    2020-11-22 16:47

    You could try to wiggle down the nesting by implementing parallel workers (like in cluster computing) instead of increasing the number of nesting function calls.

    For example: you define a limited number of slots (eg. 100) and monitor the number of "workers" assigned to each/some of them. If any slots become free, you put the waiting workers "in them".

提交回复
热议问题