• 首页
  • 前端技术
  • 编程语言
  • 人工智能
  • 运维知识
  • 资源下载
  • 常用小工具
  • 技术问答

2022-03-04

 

 

<?php set_time_limit(10);

<?php

set_time_limit(1);
$wb = 999999999;
for ($w = 0; $w < $wb; $w++) {
    echo $w * $w * $w;
}

 

 

 

w

1 <?php
2 include('w_fun.php');
3 set_time_limit(10);

 

Fatal error: Maximum execution time of 10 seconds exceeded in  ...\w_fun.php on line ...

 

http://us2.php.net/manual/en/function.set-time-limit.php

bool set_time_limit ( int $seconds )

Set the number of seconds a script is allowed to run. If this is reached, the script returns a fatal error. The default limit is 30 seconds or, if it exists, the max_execution_time value defined in the php.ini.

When called, set_time_limit() restarts the timeout counter from zero. In other words, if the timeout is the default 30 seconds, and 25 seconds into script execution a call such as set_time_limit(20) is made, the script will run for a total of 45 seconds before timing out.

Parameters ¶

seconds

The maximum execution time, in seconds. If set to zero, no time limit is imposed.

Return Values ¶

Returns TRUE on success, or FALSE on failure.

 

相关文章:

猜你喜欢
相关资源
相似解决方案
热门标签
Java Python linux javascript Mysql C# Docker 算法 前端 SpringBoot Redis Vue spring 设计模式 .net core .net kubernetes c++ 数据库 数据结构 大数据 js 机器学习 微服务 Android Go 程序员 面试 JVM ASP.net core 云原生 人工智能 后端 PHP git CSS golang k8s Nginx Django mybatis 深度学习 多线程 React 架构 devops 爬虫 云计算 Spring Boot LeetCode
By © 2026 likecs 版权所有,
本站所有数据收集于网络如有侵犯到您的权益请联系 进行下架处理1。
粤ICP备22038628号Powered By WordPress