Re: Null Coalesce Operator and Undefined Indexes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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





[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux