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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 10:01:33 2025 UTC