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.
belliash
added the bug label 2018-07-15 14:24:49 +02:00
belliash
self-assigned this 2018-07-24 15:38:05 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Aer Information
6abb65a04cYour 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.