From: RQuadling at GMail dot com Operating system: n/a PHP version: 5.4.17 Package: Scripting Engine problem Bug Type: Feature/Change Request Bug description:Enhance fatal error with class name.
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 bug report at https://bugs.php.net/bug.php?id=65274&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=65274&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=65274&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=65274&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=65274&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=65274&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=65274&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=65274&r=needscript Try newer version: https://bugs.php.net/fix.php?id=65274&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=65274&r=support Expected behavior: https://bugs.php.net/fix.php?id=65274&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=65274&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=65274&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=65274&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65274&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=65274&r=dst IIS Stability: https://bugs.php.net/fix.php?id=65274&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=65274&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=65274&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=65274&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=65274&r=mysqlcfg