On Mon, 7 Feb 2022 at 12:34, Mark Randall <marand...@php.net> wrote: > With regards to your framework comment, any framework worth its salt > will also have the option to provide a default value other than null > when the value is not provided. >
Frameworks do allow developers to provide their own default value when a GET/POST/COOKIE value has not been provided by the HTTP request. But the 4 frameworks I've noted have already chosen to return `NULL` by default... and while the distinction between an empty string and NULL is rarely used, it can be helpful. The only oddity I'm aware of is WordPress (who don't really care about types), and while `get_query_var()` doesn't exactly map to `$_REQUEST`, they did decide to use an empty string for their `$default`: https://developer.wordpress.org/reference/functions/get_query_var/ So are you suggesting that all the frameworks should change their default to an empty string? or every single project should update every use of these input functions to always override this default, or cast the received value to always be a string? all to avoid a Fatal Error if a NULL value ever dared to be passed to `htmlspecialchars()` and similar functions in PHP 9? Or would it be simpler to allow NULL for some function arguments?