Web lists-archives.com

Re: [PHP] Null Coalesce Operator and Undefined Indexes




> On Nov 27, 2017, at 11:53 AM, David Harkness <david.h@xxxxxxxxxxxxxxxxx> wrote:
> 
> You must use the ?? operator on the array access before passing it to your
> sanitize() function.
> 
>     $ua       = sanitize($_SERVER['HTTP_USER_AGENT'] ?? null);

	So close... yet so far away. ;)  Thank you, David!

Jenni
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php