Re: [RFC] anti-coalescing-operator
| From: | Ken Stanley | Date: | Thu, 24 Oct 2019 21:55:31 +0000 |
| Subject: | Re: [RFC] anti-coalescing-operator | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-107675@lists.php.net to get a copy of this message | ||
On Thu, Oct 24, 2019 at 5:31 PM Kosit Supanyo <webdevxp.com@gmail.com>
wrote:
> Hi Bruce
>
> If I understand correctly.
>
> $_SERVER['fname'] !?? $user->setName($_SERVER['fname']);
>
>
> Will return the result of $user->setName($_SERVER['fname']) if
> $_SERVER['fname'] is set or null if not set. While:
>
> isset($_SERVER['fname']) && $user->setName($_SERVER['fname']);
>
>
> Will return boolean.
>
Yes. Semantically the same, but one is terse and the other is explicit.
>
> Cheers
>
>