Home > php教程 > php手册 > body text

PHP中捕获超时事件的方法实例,php捕获超时实例

WBOY
Release: 2016-06-13 09:14:51
Original
927 people have browsed it

PHP中捕获超时事件的方法实例,php捕获超时实例

set_error_handler()不能捕获致命错误(具体错误类型见手册)。

所以需要如下方法:

<&#63;php
ini_set ( 'max_execution_time', 1 );
function shutdown() {
 $a = error_get_last ();
 print_r ( $a );
}
register_shutdown_function ( 'shutdown' );
while ( true ) {
}

Copy after login

注意:sleep()停顿时间不算在max_execution_time中。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!