From: Operating system: Ubuntu 10.04 LTS PHP version: 5.3.2 Package: Scripting Engine problem Bug Type: Bug Bug description:Naming a class method using a reserved keyword causes a parser error
Description: ------------ Is no longer possible to name a class methods using names that are reserved keywords like : 'break', 'for', 'goto'. It used to work with previous php versions. If this is a 'feature', what's the point ? Test script: --------------- <?php class foo { static function for() { echo "1"; } static function goto() { echo "2"; } } foo::for(); foo::goto(); Expected result: ---------------- Display: 12 Actual result: -------------- PHP Parse error: syntax error, unexpected T_FOR, expecting T_STRING in /etc/asterisk/manager.d/test.php on line 4 -- Edit bug report at http://bugs.php.net/bug.php?id=51709&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51709&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51709&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51709&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=51709&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51709&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=51709&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=51709&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=51709&r=needscript Try newer version: http://bugs.php.net/fix.php?id=51709&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=51709&r=support Expected behavior: http://bugs.php.net/fix.php?id=51709&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=51709&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=51709&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=51709&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51709&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=51709&r=dst IIS Stability: http://bugs.php.net/fix.php?id=51709&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=51709&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=51709&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=51709&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=51709&r=mysqlcfg