I don't really understand the following expression, what it does and how it works.
a || b = c
I guess it check if a is true, and if it's not, it run b = c?
Exemple of application:
$id || $data['created'] = $now
It's short for:
($id == true) || (($data['created'] = $now) == true)
Factoring in short circuit logic and the fact that the result of the expression itself is ignored:
if (!$id) {
$data['created'] = $now;
}
See also: Logical operators
In my understanding it means:
a OR the posibility to give b the value of c.
or in your case
$id
OR the posibility to give $data['created']
the value of $now
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With