#45223 [Opn->Bgs]: else if (...): unexpected T_IF, expecting ':'
| From: | mgf@php.net | Date: | Tue, 10 Jun 2008 08:45:43 +0000 |
| Subject: | #45223 [Opn->Bgs]: else if (...): unexpected T_IF, expecting ':' | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-125632@lists.php.net to get a copy of this message | ||
ID: 45223
Updated by: mgf@php.net
Reported By: ms419 at freezone dot co dot uk
-Status: Open
+Status: Bogus
Bug Type: *General Issues
PHP Version: 5.2.6
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Well, you've just proved that "else if" is *not* identical to "elseif"!
The error message is self-explanatory.
Previous Comments:
------------------------------------------------------------------------
[2008-06-09 20:44:51] ms419 at freezone dot co dot uk
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 this bug report at http://bugs.php.net/?id=45223&edit=1