System Architecture (eg. arm, x86_64, ...): x86_64
Your problem description
Switch block does not need closing bracket or 'endswitch' statement. If this is missing, all other code is omitted.
<?php
$x = 1;
switch($x) {
case 1:
echo '1';
case 2:
echo '2';
break;
case 3:
echo '3';
break;
default:
echo 'N';
break;
echo $x;
?>
Expected results
Above code snippet should not compile due to missing ending bracket.
Same problem occurs when SWITCH: (...) ENDSWITCH construct is used. Currently PH7 Engine checks only if both structures are not mixed together, ie. switch() { endswitch.
Current results
Presented code snippet, outputs "12" as expected, and everything after switch block is omitted. Last echo does not give any output.
<!--
1. Please speak English, this is the language all of us can speak and write.
2. Please take a moment to check that your issue doesn't already exist.
3. Please give all relevant information below for bug reports, because
incomplete details will be handled as an invalid report.
-->
# Aer Information
- Aer Version (or commit ref): 6abb65a04c
- Operating System: Linux
- System Architecture (eg. arm, x86_64, ...): x86_64
# Your problem description
Switch block does not need closing bracket or 'endswitch' statement. If this is missing, all other code is omitted.
<?php
$x = 1;
switch($x) {
case 1:
echo '1';
case 2:
echo '2';
break;
case 3:
echo '3';
break;
default:
echo 'N';
break;
echo $x;
?>
# Expected results
Above code snippet should not compile due to missing ending bracket.
Same problem occurs when SWITCH: (...) ENDSWITCH construct is used. Currently PH7 Engine checks only if both structures are not mixed together, ie. switch() { endswitch.
# Current results
Presented code snippet, outputs "12" as expected, and everything after switch block is omitted. Last echo does not give any output.
Aer Information
6abb65a04c
Your problem description
Switch block does not need closing bracket or 'endswitch' statement. If this is missing, all other code is omitted.
Expected results
Above code snippet should not compile due to missing ending bracket.
Same problem occurs when SWITCH: (...) ENDSWITCH construct is used. Currently PH7 Engine checks only if both structures are not mixed together, ie. switch() { endswitch.
Current results
Presented code snippet, outputs "12" as expected, and everything after switch block is omitted. Last echo does not give any output.
Fixed in
ae2c1e2ae5
.