Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How php does not limit execution time

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article is to share with you about how php does not limit the execution time, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

In PHP, you can use the set_time_limit () function to limit the execution time, which sets the maximum execution time of the script file and allows the script to execute indefinitely when the parameter value is set to 0; syntax "set_time_limit (0)".

Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer

In PHP, you can use the set_time_limit () function to unlimited execution time. You only need to set the following code:

Set_time_limit (0)

Set_time_limit-sets the maximum execution time of the script in seconds. If this setting is exceeded, the script returns a fatal error. The default value is 30 seconds, or the value defined in the max_execution_time of php.ini, if this value exists.

When this function is called, set_time_limit () restarts the timeout counter from scratch. In other words, if the timeout defaults to 30 seconds, and set_time_limit (20) is called when the script runs for 25 seconds, the total time for the script to run before timeout is 45 seconds.

If the parameter value of the set_time_limit () function is set to 0 (zero), there is no time limit, and the program can be executed indefinitely.

This is how php does not limit the execution time. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report