note 79183 deleted from function.error-get-last by ezyang
| From: | ezyang@php.net | Date: | Wed, 14 Nov 2007 20:14:19 +0000 |
| Subject: | note 79183 deleted from function.error-get-last by ezyang | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-132282@lists.php.net to get a copy of this message | ||
Note Submitter: Tim Williams
Reason: useless
----
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.