Edit report at https://bugs.php.net/bug.php?id=55447&edit=1
ID: 55447 User updated by: andre at neo-anime dot org Reported by: andre at neo-anime dot org Summary: Global constant declared as const parsed as class constant with token_get_all() Status: Open Type: Bug Package: Scripting Engine problem Operating System: Linux PHP Version: 5.3SVN-2011-08-18 (SVN) Block user comment: N Private report: N New Comment: Test script should be <?php const BAR = FALSE; Previous Comments: ------------------------------------------------------------------------ [2011-08-18 13:35:28] andre at neo-anime dot org 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 this bug report at https://bugs.php.net/bug.php?id=55447&edit=1