Bug #70421 [Opn]: Inconsistant constant errors
| From: | bensor987 at neuf dot fr | Date: | Thu, 03 Sep 2015 14:59:23 +0000 |
| Subject: | Bug #70421 [Opn]: Inconsistant constant errors | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-195738@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70421&edit=1
ID: 70421
User updated by: bensor987 at neuf dot fr
Reported by: bensor987 at neuf dot fr
Summary: Inconsistant constant errors
Status: Open
Type: Bug
Package: Scripting Engine problem
Operating System: Irrelevant
PHP Version: 7.0.0RC1
Block user comment: N
Private report: N
New Comment:
"Error Exception", not "Fatal Error". The Fatal Error happens when I don't
catch the Exception, sorry for that.
Previous Comments:
------------------------------------------------------------------------
[2015-09-03 14:55:39] bensor987 at neuf dot fr
Description:
------------
A Fatal Error "Undefined constant" is triggered when I use a namespace on an undefined
constant, but not when I don't.
Test script:
---------------
<?php
try {
echo \UNDEF_CONSTANT;
} catch (Error $e) {
echo "Fatal Error NS : " . $e->getMessage();
}
try {
echo UNDEF_CONSTANT;
} catch (Error $e) {
echo "Fatal Error w/o NS : " . $e->getMessage();
}
Expected result:
----------------
One of these :
- UNDEF_CONSTANTUNDEF_CONSTANT
- Fatal Error NS : Undefined constant 'UNDEF_CONSTANT'Fatal Error w/o NS : Undefined
constant 'UNDEF_CONSTANT'
Actual result:
--------------
Fatal Error NS : Undefined constant 'UNDEF_CONSTANT'UNDEF_CONSTANT
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70421&edit=1