Bug #51791 [Opn->Bgs]: constant() failed to check undefined constant and php interpreter stoped
| From: | mike@php.net | Date: | Wed, 12 May 2010 06:16:15 +0000 |
| Subject: | Bug #51791 [Opn->Bgs]: constant() failed to check undefined constant and php interpreter stoped | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-150361@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51791&edit=1
ID: 51791
Updated by: mike@php.net
Reported by: iliavlad at mail dot ru
Summary: constant() failed to check undefined constant and php
interpreter stoped
-Status: Open
+Status: Bogus
Type: Bug
Package: Reproducible crash
Operating System: Windows, Linux
PHP Version: 5.3.2
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Previous Comments:
------------------------------------------------------------------------
[2010-05-11 12:12:45] iliavlad at mail dot ru
Description:
------------
constant() failed to check undefined constant and php interpreter
stoped, but constant() should return NULL and php interpreter should
continue to work.
Test script:
---------------
class A
{
const B = 1;
}
var_dump(constant('A::B1'));
echo 5;
Expected result:
----------------
Warning: constant(): Couldn't find constant A::B1
NULL
5
Actual result:
--------------
>php -v
PHP 5.3.2 (cli) (built: Mar 3 2010 19:40:13)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
>php -r "class A { const B = 1;} var_dump(@constant('A::B1')); echo 5;"
>php -r "class A { const B = 1;} var_dump(constant('A::B1')); echo 5;"
Fatal error: Undefined class constant 'A::B1' in Command line code on
line 1
Call Stack:
0.0003 317608 1. {main}() Command line code:0
0.0003 317688 2. constant() Command line code:1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51791&edit=1