Re: [RFC] [Vote] Short Ternary Assignment Operator
| From: | Sara Golemon | Date: | Thu, 24 Mar 2016 17:39:40 +0000 |
| Subject: | Re: [RFC] [Vote] Short Ternary Assignment Operator | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-91906@lists.php.net to get a copy of this message | ||
On Thu, Mar 24, 2016 at 9:45 AM, Nikita Popov <nikita.ppv@gmail.com> wrote:
> To clarify, as the RFC only mentions this by implication:
>
> unset($x); // Assume $x is undefined
> $x ?:= $y;
>
> This will throw a notice, correct?
>
Yes. The equivalent short-ternary:
$x = $x ?: $y;
would throw a notice, so the assignment version should (and would) as well.