From:             [EMAIL PROTECTED]
Operating system: Mandrake Linux
PHP version:      4.0.5
PHP Bug Type:     *Compile Issues
Bug description:  Parser chokes on first case in switch statement if seperately 
script-delimited

Description:
The parser chokes on the first case in switch statment if the switch and
case statements are separately script-delimited.

Error message:
Parse error: parse error, expecting `T_CASE' or `T_DEFAULT' or `'}''

Example:

<? switch( $item["type"] ) { ?>
  <? case "copy": ?>    <- CHOKES ON THIS LINE
    <?= $item["copy"] ?><br>
    <? break; ?>
  <? case "tidbit": ?>
    <? $item["tidbit"]->WriteHTML(); ?>
    <? break; ?>
  ...
<? } ?>


Removing the ?> <? between the switch and first case, like this, works:

<? switch( $item["type"] ) {
  case "copy": ?>
    <?= $item["copy"] ?><br>
    <? break; ?>
  <? case "tidbit": ?>
    <? $item["tidbit"]->WriteHTML(); ?>
    <? break; ?>
  ...
<? } ?>


Thanks, you guys rock!



-- 
Edit bug report at: http://bugs.php.net/?id=13387&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to