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
 [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-2019 The PHP Group
All rights reserved.
Last updated: Fri Oct 18 04:01:27 2019 UTC