note 104456 deleted from language.operators.comparison by crell
| From: | crell@php.net | Date: | Wed, 30 Mar 2022 21:48:48 +0000 |
| Subject: | note 104456 deleted from language.operators.comparison by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-217793@lists.php.net to get a copy of this message | ||
Note Submitter: Mark Simon
----
The use of 5.3âs shortened ternary operator allows PHP to coalesce a null or empty value to an
alternative:
$value = $planA ?: $planB;
My own server doesnât yet run 5.3. A nice alternative is to use the âorâ operator:
$value = $planA or $value = planB;