Req #65274 [Asn->Opn]: Enhance fatal error with class name.
| From: | kalle@php.net | Date: | Tue, 24 Oct 2017 08:02:42 +0000 |
| Subject: | Req #65274 [Asn->Opn]: Enhance fatal error with class name. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-212207@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65274&edit=1
ID: 65274
Updated by: kalle@php.net
Reported by: RQuadling at GMail dot com
Summary: Enhance fatal error with class name.
-Status: Assigned
+Status: Open
Type: Feature/Change Request
Package: Scripting Engine problem
Operating System: n/a
PHP Version: 5.4.17
-Assigned To: laruence
+Assigned To:
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2013-07-16 15:47:24] RQuadling at GMail dot com
Description:
------------
When reporting that a class constant is undefined, the error message is only half
useful in that it doesn't say which class is missing the constant.
Whilst I can accept that the constant may be present somewhere in the class
structure, the calling class name would aid in the error.
Test script:
---------------
<?php
class A{ const NAME = 'A valid class'; }
class B{ }
foreach(array('A','B') as $s_ClassName){
echo $s_ClassName::NAME, PHP_EOL;
}
Expected result:
----------------
A valid class
PHP Fatal error: Undefined class constant 'NAME' for class 'B' in - on line 6
Actual result:
--------------
A valid class
PHP Fatal error: Undefined class constant 'NAME' in - on line 6
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65274&edit=1