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 ) {
}
Copy after login
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 (...