ID: 43213 User updated by: uli dot staerk at globalways dot net Reported By: uli dot staerk at globalways dot net Status: Open Bug Type: Scripting Engine problem PHP Version: 5.2.4 New Comment:
So there is no difference beween class constants and (common script) constants? Previous Comments: ------------------------------------------------------------------------ [2007-11-07 16:22:11] carsten_sttgt at gmx dot de You can found the answer here: http://de.php.net/manual/en/reserved.php | You cannot use any of the following words (PHP Keywords) | as constants, class names, function or method names. ("array" is one of them) Regards, Carsten ------------------------------------------------------------------------ [2007-11-07 16:09:10] uli dot staerk at globalways dot net Description: ------------ You can define class constants like: class foo { const bar = "baz"; } But if the constant-name is array, it does not work. Reproduce code: --------------- <?php class Test { const Array = "array"; } ?> Expected result: ---------------- It should work ;) Actual result: -------------- Parse error: syntax error, unexpected T_ARRAY, expecting T_STRING in test.php on line 4 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43213&edit=1