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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jc at mega-bucks dot co dot jp
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC