欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

PHP中捕獲超時(shí)事件的方法實(shí)例

 更新時(shí)間:2015年02月12日 11:21:20   投稿:junjie  
這篇文章主要介紹了PHP中捕獲超時(shí)事件的方法實(shí)例,本文直接給出示例代碼,需要的朋友可以參考下

set_error_handler()不能捕獲致命錯(cuò)誤(具體錯(cuò)誤類型見手冊)。

所以需要如下方法:

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

注意:sleep()停頓時(shí)間不算在max_execution_time中。

相關(guān)文章

最新評論