Allowing NULL for some internal functions
| From: | Craig Francis | Date: | Thu, 02 Dec 2021 14:48:19 +0000 |
| Subject: | Allowing NULL for some internal functions | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-116556@lists.php.net to get a copy of this message | ||
On Fri, 26 Nov 2021 at 16:47, Sara Golemon <pollita@php.net> wrote:
> I'm not saying send PRs to fix them all... Let's make PHP better,
> together.
On a similar theme, trying to avoid too much work for developers upgrading
to later versions of PHP.
Is there any value in me proposing an RFC to update *some* internal
functions so they can accept NULL?
I see developers using their framework of choice for GET/POST/COOKIE/etc
values (where they receive NULL to represent unset values), or simply doing
$q = ($_GET['q'] ?? NULL), and other sources... where they will now get
deprecation messages whenever they use functions like htmlspecialchars(),
trim(), strpos(), strtoupper(), strlen().
For example, a search page, where the search term is defined in the URL
(e.g. "/search/?q=abc"), and that value is shown on the page, often in an
<input type="search" name="q" value="?" /> for the
user to edit, and
sometimes repeated in the page content (where they may use strtoupper()
for styling purposes, instead of doing that via CSS `text-transform:
uppercase`).
Craig
https://externals.io/message/116076