note 79182 added to function.error-get-last

From: Date: Wed, 14 Nov 2007 17:01:06 +0000
Subject: note 79182 added to function.error-get-last
Groups: php.notes 
Request: Send a blank email to php-notes+get-132276@lists.php.net to get a copy of this message
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. ---- Server IP: 87.124.64.96 Probable Submitter: 195.173.80.1 ---- Manual Page -- http://www.php.net/manual/en/function.error-get-last.php Edit -- https://master.php.net/note/edit/79182 Del: integrated -- https://master.php.net/note/delete/79182/integrated Del: useless -- https://master.php.net/note/delete/79182/useless Del: bad code -- https://master.php.net/note/delete/79182/bad+code Del: spam -- https://master.php.net/note/delete/79182/spam Del: non-english -- https://master.php.net/note/delete/79182/non-english Del: in docs -- https://master.php.net/note/delete/79182/in+docs Del: other reasons-- https://master.php.net/note/delete/79182 Reject -- https://master.php.net/note/reject/79182 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#132276) next »