test: add if/else fixture including AltIf

This commit is contained in:
mappu 2020-04-10 11:23:47 +12:00
parent f1b7f301cc
commit 75b13e0842

30
fixtures/0012-if-else.php Normal file
View 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";