Will the use of while (1) in php cause an endless cycle?

do both php-fpm and cli modes cause an endless loop? when will while (1) be used? what are the ways to jump out of the while (1) loop

Php
Oct.13,2021

is bound to cause an endless loop. You can use the break keyword to jump out of the loop, such as a queue or to execute a script for a long time. But to pay attention to the problem that cpu takes up too much, you can use


as mentioned above, use while and sleep together, and where to use: the backend needs to run something all the time. And it takes nine times to sleep with sleep every few seconds or a period of time, and the appeal function can also be completed by using the crontab included in linux

Menu