On Wed, Jun 21, 2017 at 1:05 PM, Andrea Faulds <a...@ajf.me> wrote:
> Here's a small RFC for a small feature, which I've wondered about for a
> while: https://wiki.php.net/rfc/unary_null_coalescing_operator
>
> What do you think of it?
>
I think that  `if ($_GET['x']?? === 1)` looks and feels a lot like `if
(@$_GET['x'] === 1)`...

Yes, the latter has runtime performance issues and will still send
notices to error handlers and logs.  But perhaps if we're going to
extend syntax, the syntax could be something along the lines of:

if (@@$_GET['x'] === 1)

The double @@ could indicate "No, really, don't send any kind of
warning (or lower) anywhere.  Just deal with it.  And as a bonus, the
@@ syntax is valid in older PHPs (acting like a single @).

-Sara

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to