From: devis at witcom dot com
Operating system: Linux Debian
PHP version: 4.3.7
PHP Bug Type: Compile Failure
Bug description: Parse error with "switch" and html code
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 bug report at http://bugs.php.net/?id=29304&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29304&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29304&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=29304&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29304&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29304&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29304&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29304&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29304&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29304&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29304&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29304&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29304&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29304&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29304&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29304&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29304&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29304&r=float