test: add if/else fixture including AltIf
This commit is contained in:
parent
f1b7f301cc
commit
75b13e0842
30
fixtures/0012-if-else.php
Normal file
30
fixtures/0012-if-else.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
// Brace style
|
||||
if (true) {
|
||||
echo "1";
|
||||
} else if (false) {
|
||||
echo "2";
|
||||
} else if (true && false) {
|
||||
echo "3";
|
||||
} else if (true && false) {
|
||||
echo "3";
|
||||
} else if (true && false) {
|
||||
echo "3";
|
||||
} else if (true && false) {
|
||||
echo "3";
|
||||
} else {
|
||||
echo "4";
|
||||
}
|
||||
|
||||
// Colon style
|
||||
if (1 == 1):
|
||||
echo "5";
|
||||
elseif (2 == 2):
|
||||
echo "6";
|
||||
else:
|
||||
echo "7";
|
||||
endif;
|
||||
|
||||
// Unbraced
|
||||
if (true) echo "100";
|
Loading…
Reference in New Issue
Block a user