Bug Report
| Subject |
Details |
| Rector version |
2.6.6 |
Removing empty if block changes behaviour with elseif.
if the expression of the empty if block is true
before: nothing is executed
after: the else block is executed
Minimal PHP Code Causing Issue
<?php
$a = 1;
$b = [1];
$c = [];
if (in_array($a, $b)) {
} elseif (in_array($a, $c)) {
echo "elseif";
} else {
echo "else";
}
https://getrector.com/demo/5bd04d06-85d8-4cba-be99-f83465e58ef2
Expected Behaviour
No change.
After the rector change the else block is executed instead of nothing.
Bug Report
Removing empty if block changes behaviour with elseif.
if the expression of the empty if block is true
before: nothing is executed
after: the else block is executed
Minimal PHP Code Causing Issue
https://getrector.com/demo/5bd04d06-85d8-4cba-be99-f83465e58ef2
Expected Behaviour
No change.
After the rector change the else block is executed instead of nothing.