note 106061 modified in function.set-error-handler by danbrown

From: Date: Fri, 07 Oct 2011 14:57:06 +0000
Subject: note 106061 modified in function.set-error-handler by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-183710@lists.php.net to get a copy of this message
This actually works to catch Fatal errors... <?php function shutdown() { $a=error_get_last(); if($a==null) echo "No errors"; else print_r($a); } register_shutdown_function('shutdown'); ini_set('max_execution_time',1 ); sleep(3); ?> it will output Array ( [type] => 1 [message] => Maximum execution time of 1 second exceeded [file] => /path/to/file_name.php [line] => 136 ) --was-- This actually works to catch Fatal errors... function shutdown() { $a=error_get_last(); if($a==null) echo "No errors"; else print_r($a); } register_shutdown_function('shutdown'); ini_set('max_execution_time',1 ); sleep(3); it will output Array ( [type] => 1 [message] => Maximum execution time of 1 second exceeded [file] => /path/to/file_name.php [line] => 136 ) http://php.net/manual/en/function.set-error-handler.php

« previous php.notes (#183710) next »