Re: PHP7 Coalesce operator
| From: | Levi Morrison | Date: | Mon, 23 Nov 2015 20:03:46 +0000 |
| Subject: | Re: PHP7 Coalesce operator | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-89346@lists.php.net to get a copy of this message | ||
> In practice, you can ignore E_NOTICE and php will happily treat null and !isset() as the same
> thing in *most* cases, so that’s not a good indicator of truthiness.
If you really believe that then this is all you need already:
$database = $config['database'] ?: 'db';
Correct?