#5050 [Ana->Bgs]: $php_errormsg not changed on errors inside functions
| From: | bjori@php.net | Date: | Sun, 07 Jan 2007 10:51:01 +0000 |
| Subject: | #5050 [Ana->Bgs]: $php_errormsg not changed on errors inside functions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-107266@lists.php.net to get a copy of this message | ||
ID: 5050
Updated by: bjori@php.net
Reported By: sp at alkor dot ru
-Status: Analyzed
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: FreeBSD 4.0-R/3.x-R
PHP Version: 4.0.0 Release
New Comment:
ini_set("track_errors", 1);
Or use error_get_last()
Previous Comments:
------------------------------------------------------------------------
[2000-08-04 18:00:52] stas@php.net
Andi says it is an intended behaviour, so reclassifying is as a feature
request.
------------------------------------------------------------------------
[2000-07-23 14:59:26] stas at cvs dot php dot net
The problem here is that php_error_cb sets $php_errormsg in active
symbol table (i.e., of calling function) and not in the global symbol
table. I do not know why. Anybody does?
------------------------------------------------------------------------
[2000-06-15 05:16:10] sp at alkor dot ru
# in apache.conf: php_value track_errors on
# This problem seems exists in PHP 3.0.x too.
function boo($tag) {
global $php_errormsg;
echo("$tag: $php_errormsg<br><br>\n");
}
function bar() {
$x = @fopen("file-no-such", "r", 0);
if(!$x) boo("BAR");
}
$php_errormsg = "Croak!";
$foo = @fopen("no-such-file", "r", 0);
if(!$foo) boo("MAIN");
$php_errormsg = "Croak!"; bar();
# Request: is it possible make something like
# set_track_errors(bool) to change track_errors
# on fly.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=5050&edit=1