From: ms419 at freezone dot co dot uk Operating system: PHP version: 5.2.6 PHP Bug Type: *General Issues Bug description: else if (...): unexpected T_IF, expecting ':'
Description: ------------ PHP documentation claims: "In PHP, you can also write 'else if' (in two words) and the behavior would be identical to the one of 'elseif' (in a single word). The syntactic meaning is slightly different (if you're familiar with C, this is the same behavior) but the bottom line is that both would result in exactly the same behavior." - http://php.net/elseif However I get the following error: Parse error: syntax error, unexpected T_IF, expecting ':' in /home/jablko/public_html/test.php on line 3 Reproduce code: --------------- <?php if (false): ?> AAA <?php else if (true): ?> BBB <?php else: ?> CCC <?php endif; ?> Expected result: ---------------- BBB Actual result: -------------- Parse error: syntax error, unexpected T_IF, expecting ':' in /home/jablko/public_html/test.php on line 3 -- Edit bug report at http://bugs.php.net/?id=45223&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45223&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45223&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45223&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=45223&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=45223&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=45223&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=45223&r=needscript Try newer version: http://bugs.php.net/fix.php?id=45223&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=45223&r=support Expected behavior: http://bugs.php.net/fix.php?id=45223&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=45223&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=45223&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=45223&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45223&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=45223&r=dst IIS Stability: http://bugs.php.net/fix.php?id=45223&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=45223&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=45223&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=45223&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=45223&r=mysqlcfg