Re: [PHP-DEV] [RFC] Implicit isset() in Shorthand Ternary Operator

[email protected] (Simon Schick)
Newsgroups php.internals
Message-ID <CAJWj5+GttUCTU=Z=p5j-+SkGQCQt=6on4cgSo4YNSQZRhQ0U7w@mail.gmail.com>
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 <[email protected]> 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
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.