Krejouche - PHP and Symfony
Krejouche - PHP and Symfony
0 (integer)
[] (empty array)
Operators
Run a command
Operator Precedence
Comparison operators run a generic php bin/console app:test
symfony
command :
Ternary operator ?:
run a php -d memory_limit=2G bin/console
$var = expr1 ? expr2 : expr3; if (expr1 = true) {
command ...
$var = expr2
giving PHP
else
more
$var = expr3
memory
}
PHPMD /**
Suppress * @SuppressWarnings(PHPMD.LongVariable
Warnings )
Comment * @SuppressWarnings(PHPMD.UnusedLocal
annota‐ Variable)
tions on a */
class or a
method
match() expression
The $food = 'cake';
match() $return_value = match ($food) {
expression 'apple' => 'This food is an apple',
branches 'bar' => 'This food is a bar',
evaluation 'cake' => 'This food is a cake',
based on };
an identity
check of a
value.
Unlike
switch, it
will
evaluate to
a value
much like
ternary
expres‐
sions.
Unlike
switch, the
comparison
is an
identity
check
(===)
rather than
a weak
equality
check (==).