note 79183 added to function.error-get-last
| From: | TimWilliams at osu1 dot php dot net | Date: | Wed, 14 Nov 2007 17:03:32 +0000 |
| Subject: | note 79183 added to function.error-get-last | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132277@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/79183
Del: integrated -- https://master.php.net/note/delete/79183/integrated
Del: useless -- https://master.php.net/note/delete/79183/useless
Del: bad code -- https://master.php.net/note/delete/79183/bad+code
Del: spam -- https://master.php.net/note/delete/79183/spam
Del: non-english -- https://master.php.net/note/delete/79183/non-english
Del: in docs -- https://master.php.net/note/delete/79183/in+docs
Del: other reasons-- https://master.php.net/note/delete/79183
Reject -- https://master.php.net/note/reject/79183
Search -- https://master.php.net/manage/user-notes.php