php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44988 E_NOTICE error when referring to line
Submitted: 2008-05-13 22:55 UTC Modified: 2008-05-14 18:14 UTC
From: lgandras at hotmail dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.2.6 OS: *
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: lgandras at hotmail dot com
New email:
PHP Version: OS:

 

 [2008-05-13 22:55 UTC] lgandras at hotmail dot com
Description:
------------
When error_reporting is set to E_ALL and a variable that is undefined is concatenated, the line of the E_NOTICE error is set to the last line of the concatenation.

Reproduce code:
---------------
<?php
error_reporting(E_ALL);
$undefined .= 
"some string";
?>

Expected result:
----------------
Notice: Undefined variable: undefined in C:\Documents and Settings\Andras Gyomrey\Mis documentos\www\error.php on line 3

Actual result:
--------------
Notice: Undefined variable: undefined in C:\Documents and Settings\Andras Gyomrey\Mis documentos\www\error.php on line 4

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-14 07:44 UTC] jani@php.net
That's where the line begins. No bug here.
 [2008-05-14 18:14 UTC] lgandras at hotmail dot com
I meant for example that if i put:

<?php
error_reporting(E_ALL);
$undefined .= 
"some".
"buggy ".
"string ";
?>

The message would say the line of the error would be the sixth  instead of the third. My problem came when i was looking for the "undefined" variable. It is right, that the value will be set, when the hole string is parsed. But I don't think that the common interest is where the string is completely parsed, but the line where the undefined variable resides.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 09:01:31 2025 UTC