php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #5050 $php_errormsg not changed on errors inside functions
Submitted: 2000-06-15 05:16 UTC Modified: 2007-01-07 10:50 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: sp at alkor dot ru Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.0.0 Release OS: FreeBSD 4.0-R/3.x-R
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sp at alkor dot ru
New email:
PHP Version: OS:

 

 [2000-06-15 05:16 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-23 14:59 UTC] 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-08-04 18:00 UTC] stas@php.net
Andi says it is an intended behaviour, so reclassifying is as a feature request.
 [2007-01-07 10:50 UTC] bjori@php.net
ini_set("track_errors", 1);
Or use error_get_last()
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 10:01:29 2024 UTC