#21934 [Opn->Bgs]: $php_errmsg superglobal not accessible

From: Date: Wed, 29 Jan 2003 10:52:06 +0000
Subject: #21934 [Opn->Bgs]: $php_errmsg superglobal not accessible
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-31550@lists.php.net to get a copy of this message
ID: 21934 Updated by: derick@php.net Reported By: jc@mega-bucks.co.jp -Status: Open +Status: Bogus Bug Type: Compile Warning Operating System: Red Hat Linux 7.2 PHP Version: 4.3.0 New Comment: Ok, not a PHP bug, let's mark it bogus. Previous Comments: ------------------------------------------------------------------------ [2003-01-29 04:51:24] jc@mega-bucks.co.jp My mistake! Spelling error. Was using a script posted on the web. Sorry. ------------------------------------------------------------------------ [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

« previous php.bugs (#31550) next »