I just came across an answer for javascript and tried out. It actually works in a way that compare to looping through the whole array, it eliminates the screen-frozen effect: https://stackoverflow.com/a/10344560/2083396
So my questions is: is there any similar way in PHP to improve performance?
My understanding is that in the javascript solution, after each timeout callback is called, its scope is destroyed. And thus the resource is released. (did I understand it correctly?)
Is there any way we could do so in PHP and does it help?
Thanks!