Bug #55447 [NEW]: Global constant declared as const parsed as class constant with token_get_all()
| From: | andre at neo-anime dot org | Date: | Thu, 18 Aug 2011 13:35:28 +0000 |
| Subject: | Bug #55447 [NEW]: Global constant declared as const parsed as class constant with token_get_all() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-162650@lists.php.net to get a copy of this message | ||
From:
Operating system: Linux
PHP version: 5.3SVN-2011-08-18 (SVN)
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Global constant declared as const parsed as class constant with token_get_all()
Description:
------------
As of PHP 5.3.0 global constants can be declared using the const keyword in
addition to the define() function. However token_get_all() incorrectly
recognizes
the former as a class constant.
Test script:
---------------
<?php
define('BAR', FALSE);
Expected result:
----------------
T_OPEN_TAG
T_STRING
T_CONSTANT_ENCAPSED_STRING
T_WHITESPACE
T_STRING
Actual result:
--------------
T_OPEN_TAG
T_CONST
T_WHITESPACE
T_STRING
T_WHITESPACE
T_WHITESPACE
T_STRING
--
Edit bug report at https://bugs.php.net/bug.php?id=55447&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55447&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55447&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55447&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=55447&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55447&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=55447&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=55447&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=55447&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=55447&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=55447&r=support
Expected behavior: https://bugs.php.net/fix.php?id=55447&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=55447&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=55447&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=55447&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55447&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=55447&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=55447&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=55447&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=55447&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=55447&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=55447&r=mysqlcfg