php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52775 Parse error of <?php switch ($a) : ?>
Submitted: 2010-09-04 06:47 UTC Modified: 2010-09-04 14:19 UTC
From: yutaka dot nakadouzono at gmail dot com Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.2.14 OS: FreeBSD
Private report: No CVE-ID: None
 [2010-09-04 06:47 UTC] yutaka dot nakadouzono at gmail dot com
Description:
------------
space of bitween switch and case make parse error.
PHP version:5.2.13

Test script:
---------------
## Success ###########
<?php $a = 1; ?><?php switch ($a) : ?><?php case 1: ?>1<?php break; ?><?php endswitch; ?>

## Error ###########
<?php $a = 1; ?><?php switch ($a) : ?> <?php case 1: ?>1<?php break; ?><?php endswitch; ?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-09-04 14:19 UTC] johannes@php.net
-Status: Open +Status: Bogus
 [2010-09-04 14:19 UTC] johannes@php.net
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

<?php switch ($a) : ?> <?php case 1: ?>

is essentially the same as

<?php switch ($a) : echo " "; case 1: ?>

which obviously is wrong.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 18:01:35 2024 UTC