|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21934 $php_errmsg superglobal not accessible
Submitted: 2003-01-29 04:38 UTC Modified: 2003-01-29 04:52 UTC
From: jc at mega-bucks dot co dot jp Assigned:
Status: Not a bug Package: Compile Warning
PHP Version: 4.3.0 OS: Red Hat Linux 7.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
34 + 29 = ?
Subscribe to this entry?

 [2003-01-29 04:38 UTC] jc at mega-bucks dot co dot jp
According to the documentation at (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.


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;


Notice: Undefined variable: php_errmsg in err.php on line 5

Notice: Undefined variable: php_errmsg in err.php on line 7


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-29 04:51 UTC] jc at mega-bucks dot co dot jp
My mistake! Spelling error. Was using a script posted on the web. Sorry.
 [2003-01-29 04:52 UTC]
Ok, not a PHP bug, let's mark it bogus.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Aug 12 00:03:34 2022 UTC