|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-12-14 14:19 UTC] yohgaki@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 02:00:01 2025 UTC |
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!