php.net |  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
 [2003-01-29 04:38 UTC] jc at mega-bucks dot co dot 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] derick@php.net
Ok, not a PHP bug, let's mark it bogus.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Oct 28 18:01:24 2020 UTC