Skip to content

Commit 8a70e4d

Browse files
photodudewilsonge
authored andcommitted
Add note on Exclamation mark ! logical operator (#220)
Reference #113
1 parent 148bb42 commit 8a70e4d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

manual/php.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ For all control structures there is a space between the keyword and an opening p
4545

4646
For all all control structures, such as `if`, `else`, `do`, `for`, `foreach`, `try`, `catch`, `switch` and `while`, both the keyword starts a newline and the opening and closing braces are each put on a new line.
4747

48+
Exclamation mark `!`, the logical operator `not` used in a condition, should not have spaces before or after the exclamation mark as shown in the examples.
49+
4850
#### An _if-else_ Example
4951

5052
```php
@@ -55,11 +57,14 @@ if ($test)
5557

5658
// Comments can go here.
5759
// Note that "elseif" as one word is used.
58-
5960
elseif ($test === false)
6061
{
6162
echo 'Really false';
6263
}
64+
elseif (!$condition)
65+
{
66+
echo 'Not Condition';
67+
}
6368
else
6469
{
6570
echo 'A white lie';

0 commit comments

Comments
 (0)