php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #54715 Reporting error line about undefined constant
Submitted: 2011-05-12 02:46 UTC Modified: 2011-07-02 18:30 UTC
From: lgandras at gmail dot com Assigned:
Status: Duplicate Package: Scripting Engine problem
PHP Version: 5.3.6 OS: CentOS 5.4
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: lgandras at gmail dot com
New email:
PHP Version: OS:

 

 [2011-05-12 02:46 UTC] lgandras at gmail dot com
Description:
------------
Hi,

For me the following script should report the error line 4, not 7. It wasn't so 
obvious to track down the issue.

I read this bug http://bugs.php.net/bug.php?id=38324, but class constants may not 
be defined in runtime.

Test script:
---------------
<?php

class A{
  public $arr = array(self::UNDEFINED_CONST);
}

new A;

Expected result:
----------------
Fatal error: Undefined class constant 'self::UNDEFINED_CONST' in - on line 3

Actual result:
--------------
Fatal error: Undefined class constant 'self::UNDEFINED_CONST' in - on line 7

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-01 23:08 UTC] frozenfire@php.net
-Package: Unknown/Other Function +Package: Scripting Engine problem
 [2011-07-02 18:30 UTC] frozenfire@php.net
-Status: Open +Status: Duplicate
 [2011-07-02 18:30 UTC] frozenfire@php.net
As you mention in your description, this bug is a duplicate of bug #38324.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC