3 ms·
With all notices on accessing an undefined index is a notice, which you're doing with that syntax, no?
by bpicolo 9y ago
With all notices on accessing an undefined index is a notice, which you're doing with that syntax, no?
- CiPHPerCoder 9y agoNope. https://3v4l.org/J45qU https://3v4l.org/J45qU
- bpicolo 9y agoAhh this is new in 7.0. Good to know, hadn't seen that. Still of the opinion that the array builtins are a hassle. =]
- deleted 9y ago[deleted]
- aruggirello 9y agoNo notices - But this syntax has been introduced in 7.0. Old style is: isset($array[$key]) ? $array[$key] : $default Which is, admittedly, just a bit uglier. Edit: isset() is a language construct, not a function call. So it does not incur performance penalties. The ?? operator was introduced for 'cosmetic' reasons only, so don't rush to update your source...