php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38324 wrong error line number
Submitted: 2006-08-04 03:29 UTC Modified: 2006-08-04 09:37 UTC
From: ftl_ at freemail dot hu Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.1.4 OS: Linux / Windows
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: ftl_ at freemail dot hu
New email:
PHP Version: OS:

 

 [2006-08-04 03:29 UTC] ftl_ at freemail dot hu
Description:
------------
wrong line number for "Use of undefined constant" notice.

Reproduce code:
---------------
<?php
error_reporting(E_ALL);
class A {
  public $a = UNDEFINED_CONSTANT;
}
$obj = new A;
?>

Expected result:
----------------
Notice: Use of undefined constant UNDEFINED_CONSTANT - assumed 'UNDEFINED_CONSTANT' in [..]/test.php on line 4

Actual result:
--------------
Notice: Use of undefined constant UNDEFINED_CONSTANT - assumed 'UNDEFINED_CONSTANT' in [..]/test.php on line 6

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-04 09:37 UTC] tony2001@php.net
The engine tries to resolve UNDEFINED_CONSTANT in runtime, because it can be defined in previously included files (which are included in runtime too) or somewhere else.
So the behaviour is expected and the error message is correct.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 13:01:29 2024 UTC