... implementing the "Elvis operator" ... as $x ? $x : $y
Actually, I read the opposite from the Wiki article:
... the Elvis operator expression A ?: B is approximately equivalent to the ternary conditional expression A ? A : B
... something like ... x = f() ?: g() ... is equivalent to ... the conditional ternary operator x = f() ? f() : g() except that it does not evaluate f() twice if it yields truthy.
Accentuations by me.
Greetings,
🐻
In reply to Re^4: Logical/defined or as lvalue
by jo37
in thread Logical/defined or as lvalue
by jo37
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |