note 79182 deleted from function.error-get-last by felipe

From: Date: Sun, 16 Dec 2007 01:37:49 +0000
Subject: note 79182 deleted from function.error-get-last by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-133620@lists.php.net to get a copy of this message
Note Submitter: Tim Williams ---- It's worth noting that when running PHP as a module, this will return the last error regardless of the request scope. For example, if we request error.php, that looks like this: <?php echo $cheese;?> We get: "Notice: Undefined variable: cheese in D:\webs\error.php on line 1". If we then run test.php, that looks like this: <?php $lastError = error_get_last(); var_dump($lastError); ?> We get: array(4) { ["type"]=> int(8) ["message"]=> string(26) "Undefined variable: cheese" ["file"]=> string(17) "D:\webs\error.php" ["line"]=> int(1) } Also, if an errors suppressed using the '@' character will still be picked up by error_get_last.

« previous php.notes (#133620) next »