A method instance for capturing timeout events in PHP. Example of methods for capturing timeout events in PHP this article mainly introduces the example of methods for capturing timeout events in PHP. This article provides the sample code directly, for more information about how to capture timeout events, see set_error_h PHP.
This article mainly introduces how to capture timeout events in PHP. This article provides sample code directly. For more information, see
Set_error_handler () cannot catch fatal errors (for specific error types, see the manual ).
Therefore, the following method is required:
?
1 2 3 4 5 6 7 8 9 |
Ini_set ('max _ execution_time ', 1 ); Function shutdown (){ $ A = error_get_last (); Print_r ($ ); } Register_shutdown_function ('shutdown '); While (true ){ } |
Note: The sleep () pause time is not included in max_execution_time.
This article describes how to capture timeout events in PHP. This article provides sample code directly. For more information, see set_error_h...