4 ms·
No 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.
by aruggirello 9y ago
No 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...