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

Add a Patch

Pull Requests

Add a Pull Request

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-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC