Re: Revisiting RFC: Engine Warnings -- Undefined array index
| From: | Derick Rethans | Date: | Tue, 13 Dec 2022 14:14:03 +0000 |
| Subject: | Re: Revisiting RFC: Engine Warnings -- Undefined array index | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-119120@lists.php.net to get a copy of this message | ||
On Mon, 12 Dec 2022, Rowan Tommins wrote:
> On 12 December 2022 22:20:27 GMT, Dan Liebner <dliebner@gmail.com> wrote:
> >Here's my biggest criticism: the change essentially forces this:
> >$arr['key']
> >
> >to be rewritten as this (or some other intolerably bad alternative):
> >isset($arr) && isset($arr['key']) && $arr['key']
>
>
> Fortunately, this is not the case, the actual replacement code is this:
>
> $arr['key'] ?? null
Or before ?? was a thing, like:
filter_input(INPUT_GET, 'key')
cheers,
Derick
--
https://derickrethans.nl | https://xdebug.org | https://dram.io
Author of Xdebug. Like it? Consider supporting me: https://xdebug.org/support
Host of PHP Internals News: https://phpinternals.news
mastodon: @derickr@phpc.social @xdebug@phpc.social
twitter: @derickr and @xdebug