Altering operator precedence with parentheses

suggest change

The order in which operators are evaluated is determined by the operator precedence (see also the Remarks section).

In

$a = 2 * 3 + 4;

$a gets a value of 10 because 2 * 3 is evaluated first (multiplication has a higher precedence than addition) yielding a sub-result of 6 + 4, which equals to 10.

The precedence can be altered using parentheses: in

$a = 2 * (3 + 4);

$a gets a value of 14 because (3 + 4) is evaluated first.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Operators:
* Altering operator precedence with parentheses

Table Of Contents
2 Arrays
4 Types
10 Cookies
14 JSON
15 SOAP
17 cURL
19 XML
21 Traits
33 Operators
35 UTF-8
36 URLs
38 PHPDoc
41 Loops
44 Closur
72 YAML
77 Cache
78 Streams
81 PDO
82 SQLite3
83 Sockets
87 MongoDB
93 IMAP
94 Redis
95 Imagick
102 APCu
108 PSR