File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
tests/PHPStan/Rules/Comparison Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,10 @@ public function testBug11674(): void
135135 'Elseif condition is always false. ' ,
136136 28 ,
137137 ],
138+ [
139+ 'Elseif condition is always false. ' ,
140+ 36 ,
141+ ],
138142 ]);
139143 }
140144
Original file line number Diff line number Diff line change @@ -10,31 +10,31 @@ function show() : void {
1010 if ((int ) $ this ->param ) {
1111 echo 1 ;
1212 } elseif ($ this ->param ) {
13- echo 2 ;
13+ echo 2 ; // might be "0"
1414 }
1515 }
1616
1717 function show2 () : void {
1818 if ((float ) $ this ->param ) {
1919 echo 1 ;
2020 } elseif ($ this ->param ) {
21- echo 2 ;
21+ echo 2 ; // might be "0"
2222 }
2323 }
2424
2525 function show3 () : void {
2626 if ((bool ) $ this ->param ) {
2727 echo 1 ;
2828 } elseif ($ this ->param ) {
29- echo 2 ;
29+ echo 2 ; // not possible
3030 }
3131 }
3232
3333 function show4 () : void {
3434 if ((string ) $ this ->param ) {
3535 echo 1 ;
3636 } elseif ($ this ->param ) {
37- echo 2 ;
37+ echo 2 ; // not possible
3838 }
3939 }
4040}
You can’t perform that action at this time.
0 commit comments