Re: [RFC] Implicit isset() in Shorthand Ternary Operator
| From: | Simon Schick | Date: | Mon, 08 Sep 2014 07:58:02 +0000 |
| Subject: | Re: [RFC] Implicit isset() in Shorthand Ternary Operator | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-77097@lists.php.net to get a copy of this message | ||
Hi, Andrea
I feel more like Sherif Ramadan. Even so I've quite often been in the same
situation, I don't think it's a good solution to change something like
that, just for the shorthand-operator.
I think, the notice is really valuable when accessing the value and doing
something with it - like myFunction($_GET['not_set']), but if you're just
checking for the existence, I, too, think it is more annoying. My way was
to suppress it by adding the silence-operator ;)
I always used like:
@$_GET['mykey'] ?: ””
I can't come up with a good mid-way right now, but I don't think it's a
good way to change this ONLY for the short-hand operator.
Bye,
Simon
On Sat, Sep 6, 2014 at 2:02 AM, Andrea Faulds <ajf@ajf.me> wrote:
> Good evening,
>
> I’ve written an RFC and working patch which attempt to add this feature
> which has been often requested:
> https://wiki.php.net/rfc/isset_ternary
>
> Thanks!
> --
> Andrea Faulds
> http://ajf.me/
>
>
>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>