php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #19236 Need $php_errorLineNumber $php_errorScript in addition to $php_errormsg
Submitted: 2002-09-04 16:49 UTC Modified: 2012-09-22 09:20 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:2 (66.7%)
From: php-bugs at ketan dot org Assigned: nikic (profile)
Status: Closed Package: *General Issues
PHP Version: 4.2.2 OS: FreeBSD
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php-bugs at ketan dot org
New email:
PHP Version: OS:

 

 [2002-09-04 16:49 UTC] php-bugs at ketan dot org
When using ini configuration directive track_errors = On, $php_errormsg contains the last error message.  We need a corresponding variable $php_errorLineNumber (or whatever) that keeps track of where in the file the error occurred, and $php_errorScriptName to tell in which file the error occurred (in case of include()).

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-04 17:11 UTC] wez@php.net
That's too much magic; you can do this yourself using
set_error_handler and having your error handler set up
these global vars yourself.
 [2002-09-04 18:13 UTC] php-bugs at ketan dot org
It is half done the way it is now.  If we have $php_errormsg, then we should have the other components of the standard php error, the line number and the script name.  An error message in isolation is not very useful.
 [2006-04-25 13:10 UTC] jason_priebe at yahoo dot com
I get the point of an error_handler, but this doesn't help
when you're eval-ing code that contains a parse error.
The parse error doesn't trigger the error_handler.
$php_errormsg contains the actual error string, but doesn't
tell you what line of the eval-ed code contained the error.
The httpd error log contains the offending line number, but
AFAICT, I can't get to it inside my PHP code.
 [2012-09-22 09:20 UTC] nikic@php.net
Closing as error_get_last() provides this information as of PHP 5.2.
 [2012-09-22 09:20 UTC] nikic@php.net
-Status: Open +Status: Closed -Package: Feature/Change Request +Package: *General Issues -Assigned To: +Assigned To: nikic
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 02:01:27 2024 UTC