Small note about control structures

This commit is contained in:
Paul Gear
2015-07-10 21:22:40 +10:00
parent 1e508e9bf6
commit 60b39cfa41

View File

@@ -37,6 +37,21 @@ if ($foo == 5) {
}
```
Start else and elsif on new lines, e.g.
```php
if ($foo == 5) {
echo 'foo is 5';
}
elsif ($foo == 4) {
echo 'foo is 4';
}
else {
echo 'foo is something else';
}
```
This makes diffs much cleaner when moving around blocks of code.
### Including files
Using parenthesis around file includes isn't required, instead just place the file in between ''
```php