PHP 4.0 Bug #5050: $php_errormsg not changed on errors inside functions
| From: | sp at alkor dot ru | Date: | Thu, 15 Jun 2000 03:16:10 +0000 |
| Subject: | PHP 4.0 Bug #5050: $php_errormsg not changed on errors inside functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-21373@lists.php.net to get a copy of this message | ||
From: sp@alkor.ru
Operating system: FreeBSD 4.0-R/3.x-R
PHP version: 4.0.0 Release
PHP Bug Type: Scripting Engine problem
Bug description: $php_errormsg not changed on errors inside functions
# 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.