Is this what you meant? Taken literally, $a has a defined value, and the tertiary operator is unnecessary, so I presume you are looking for a default value kind of operation.
Your third example is not reducible. At least, not by me.$a = 'text'; $b = $a || '';
In reply to Re: check for existing value, else set to default
by pbeckingham
in thread check for existing value, else set to default
by nmerriweather
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |