Edit report at https://bugs.php.net/bug.php?id=64735&edit=1

 ID:                 64735
 Updated by:         larue...@php.net
 Reported by:        nick at savvior dot com
 Summary:            PHP alternative syntax is not parsed correctly
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            *Programming Data Structures
 Operating System:   windows 7
 PHP Version:        5.4.14
 Block user comment: N
 Private report:     N

 New Comment:

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

"Mixing syntaxes in the same control block is not supported." 
http://www.php.net/manual/en/control-structures.alternative-syntax.php


Previous Comments:
------------------------------------------------------------------------
[2013-04-29 17:31:45] nick at savvior dot com

Description:
------------
5.4.3 using WAMP

To reproduce

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

<?php

if (1):
if (1){}
else:
endif;

?>

result: 
syntax error: unexpected ':'






Test script:
---------------
<?php

//parse error
if (1):
if (1){}
else:
endif;


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

?>




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.


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64735&edit=1

Reply via email to