News for hackers. Stuff that matters.
Re:Simply Secure PHP Cryptography by stephenr on Thursday July 13, 2017 @02:45PM (#14763987)
> get_default($array, $key, $default).

$array[$key] ?? $default

im still not sure what any of this has to do with "the only secure php is no php"?

Re:Simply Secure PHP Cryptography by bpicolo on Thursday July 13, 2017 @02:49PM (#14764018)
With all notices on accessing an undefined index is a notice, which you're doing with that syntax, no?
Re:Simply Secure PHP Cryptography by aruggirello on Thursday July 13, 2017 @03:47PM (#14764544)
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...

Re:Simply Secure PHP Cryptography by CiPHPerCoder on Thursday July 13, 2017 @02:50PM (#14764033)
Re:Simply Secure PHP Cryptography by bpicolo on Thursday July 13, 2017 @02:52PM (#14764053)
Ahh this is new in 7.0. Good to know, hadn't seen that. Still of the opinion that the array builtins are a hassle. =]