ID: 29304
User updated by: devis at witcom dot com
Reported By: devis at witcom dot com
Status: Bogus
Bug Type: Compile Failure
Operating System: Linux Debian
PHP Version: 4.3.7
New Comment:
<? 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 ?
Previous Comments:
------------------------------------------------------------------------
[2004-07-21 16:37:13] [EMAIL PROTECTED]
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
Read Zeev's response to the original bug report.
------------------------------------------------------------------------
[2004-07-21 16:17:38] 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"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29304&edit=1