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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: yutaka dot nakadouzono at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 09:01:34 2025 UTC