#21934 [Com]: $php_errmsg superglobal not accessible
| From: | jc at mega-bucks dot co dot jp | Date: | Wed, 29 Jan 2003 10:51:24 +0000 |
| Subject: | #21934 [Com]: $php_errmsg superglobal not accessible | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-31549@lists.php.net to get a copy of this message | ||
ID: 21934
Comment by: jc@mega-bucks.co.jp
Reported By: jc@mega-bucks.co.jp
Status: Open
Bug Type: Compile Warning
Operating System: Red Hat Linux 7.2
PHP Version: 4.3.0
New Comment:
My mistake! Spelling error. Was using a script posted on the web.
Sorry.
Previous Comments:
------------------------------------------------------------------------
[2003-01-29 04:38:43] jc@mega-bucks.co.jp
According to the documentation at
http://jp.php.net/manual/en/reserved.variables.php
(at the very end)
"$php_errormsg is a variable containing the text of the last error
message generated by PHP. This variable will only be available within
the scope in which the error occurred, and only if the track_errors
configuration option is turned on (it defaults to off)."
I have tried accessing this variable but to no avail. It always throws
an "Undefined variable" warning.
TEST SCRIPT:
<?php
ini_set("track_errors", true);
error_reporting (E_ALL);
$a = $php_errmsg;
//the above line threw a warning so now php_errmsg should be
initialized ...
$a = $php_errmsg;
echo $a;
exit;
?>
OUPUT:
Notice: Undefined variable: php_errmsg in err.php on line 5
Notice: Undefined variable: php_errmsg in err.php on line 7
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21934&edit=1