|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64735 PHP alternative syntax is not parsed correctly
Submitted: 2013-04-29 17:31 UTC Modified: 2013-04-30 02:36 UTC
Avg. Score:1.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: nick at savvior dot com Assigned:
Status: Not a bug Package: *Programming Data Structures
PHP Version: 5.4.14 OS: windows 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: nick at savvior dot com
New email:
PHP Version: OS:


 [2013-04-29 17:31 UTC] nick at savvior dot com
5.4.3 using WAMP

To reproduce

The bug occurs only when you include the else: portion.


if (1):
if (1){}


syntax error: unexpected ':'

Test script:

//parse error
if (1):
if (1){}

//works fine
if (1):
	if (1){}?><?


Expected result:
I expect to be able to use a traditional control structure syntax within the 
alternative syntax and have it parse correctly.

Actual result:
if else: is added after an if (): block that contains a traditional if statement 
w/o adding ?><? then it will be a parse error.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-04-30 02:36 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

"Mixing syntaxes in the same control block is not supported."
 [2013-04-30 02:36 UTC]
-Status: Open +Status: Not a bug
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Feb 24 23:01:27 2024 UTC