in reply to check for existing value, else set to default
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 || '';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: check for existing value, else set to default
by waswas-fng (Curate) on Apr 26, 2004 at 06:03 UTC |