Operators

Using variables is nice, but if we cannot make them interact with each other, there is nothing much we can do. Operators are elements that take some expressions—operands—and perform actions on them to get a result. The most common examples of operators are arithmetic operators, which you already saw previously.

An expression is almost anything that has a value. Variables, numbers, or text are examples of expressions, but you will see that they can get way more complicated. Operators expect expressions of a specific type, for example, arithmetic operators expect either integers or floats. But as you already know, PHP takes care of transforming the types of the expressions given whenever possible.

Let's take a look at the most important ...

Get Learning PHP 7 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.