Examples of methods to capture timeout events in PHP, PHP capture timeout examples
set_error_handler() cannot catch fatal errors (see the manual for specific error types).
So the following method is needed:
<?php
ini_set ( 'max_execution_time', 1 );
function shutdown() {
$a = error_get_last ();
print_r ( $a );
}
register_shutdown_function ( 'shutdown' );
while ( true ) {
}
Note: sleep() pause time is not included in max_execution_time.
http://www.bkjia.com/PHPjc/957121.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/957121.htmlTechArticleMethod instance for capturing timeout event in PHP, php capture timeout instance set_error_handler() cannot capture fatal error (specific error type See manual). So the following method is needed: phpini_set (...
Statement: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