Skip to content

Instantly share code, notes, and snippets.

@EionRobb
Created July 26, 2017 01:53
Show Gist options
  • Select an option

  • Save EionRobb/10906f82ede74970752b8d321a5a8bb7 to your computer and use it in GitHub Desktop.

Select an option

Save EionRobb/10906f82ede74970752b8d321a5a8bb7 to your computer and use it in GitHub Desktop.
<?php
function max_execution_time_handler() {
set_time_limit(0);
$err = error_get_last();
if ($err != null && preg_match('@^Maximum execution time@', $err['message'])) {
ob_start();
debug_print_backtrace();
$backtrace = ob_get_clean();
error_log($backtrace);
}
}
register_shutdown_function('max_execution_time_handler');
ini_set('max_execution_time', 1);
sleep(3);
echo 'here';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment