|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-07-21 16:17 UTC] devis at witcom dot com
Description: ------------ Bug #11447 REOPENED when ther is html code between "switch" and the first "case" php reports this error: "Parse error: parse error, expecting `T_ENDSWITCH' or `T_CASE' or `T_DEFAULT'" the problem occurs while indenting html+php code: <html> <body> <?switch ($a):?> <?case 0: echo "zero"; break;?> <?default: echo "one"; break;?> <?endswitch;?> </body> </html> Reproduce code: --------------- THIS WORKS: <html> <?switch ($a):?> <?case 0: echo "zero"; break;?> <?default: echo "one"; break;?> <?endswitch;?> </html> THIS DOESN'T WORK: <html> <?switch ($a):?> [space]<?case 0: echo "zero"; break;?> <?default: echo "one"; break;?> <?endswitch;?> </html> Expected result: ---------------- "zero" PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 23:00:02 2025 UTC |
<? switch($var){ ?> <? case "alpha": break; }?> should be equivalent to <? switch($var){ print "\n" case "alpha": break; }?> so why does it work if this <? switch($var){ print " " case "alpha": break; }?> does not work ?