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
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: 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

Pull Requests

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: Sun Dec 22 05:01:30 2024 UTC