PHP cannot be executed after writing sleep

Source: Internet
Author: User
After writing sleep in PHP, you cannot execute this post. after editing the sleep in PHP at 2015-04-, the webpage is always loading, the result cannot be displayed. The following is the source code & lt ;? Phpignore_user_abort (true); set_time_limit (0); $ k0; $ I PHP cannot be executed after writing sleep

This post was last edited by qq_270000201 at 12:15:35, January 10 ,.

After writing sleep in PHP, the webpage running display is always loading and the result cannot be displayed.

Source code

Ignore_user_abort (true );
Set_time_limit (0 );
$ K = 0;
$ Interval = 5;
Do {
Echo $ k;
$ K ++;
Sleep ($ interval); // you can run the command by commenting out this sentence.
}
While (true)
?>
------ Solution ----------------------
Is there an endless loop with no timeout limit?
------ Solution ----------------------
Whether or not sleep ($ interval );
None of your programs can be normal, because it is an endless loop.
Sleep only prolongs the interval between the two output 0 values.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.