Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116556 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 89805 invoked from network); 2 Dec 2021 13:49:35 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 Dec 2021 13:49:35 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8EDCD1804F8 for ; Thu, 2 Dec 2021 06:48:33 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 2 Dec 2021 06:48:33 -0800 (PST) Received: by mail-lf1-f52.google.com with SMTP id r26so72085590lfn.8 for ; Thu, 02 Dec 2021 06:48:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=craigfrancis.co.uk; s=default; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=f0bg6m0pX+zLrC9b4POMxax1YcNwg8I43iZnsUZC6x4=; b=KRTAKZRP+iIyKJKFfFqyij8G1nqzYOEJejWB/78TDTdXAgS7Bw6meoifRvzhRvMsaQ +sdOvvcqN1hu1AvXRWtRMbg/J7NTxNVvBY0zQdAgoPq7Ob49Qipyplkg1BPVKoPi09gb X/P33xVa2U9xso+frLHal37HC7j8EYMr1rFcg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=f0bg6m0pX+zLrC9b4POMxax1YcNwg8I43iZnsUZC6x4=; b=WlNoQopypIkToteK+t/71oBxM1Lfs774uJuQtKENaSdPyAzF9yEjVqJ0Po8CjO8j+H KHVIwGZ7AH/gLm/oEmnBkMPL/p/XiY8VpnxnSjBSJfdTg++p5M2e6lMvQl8lpHpGIMBP Snlf7zSKX1gnRDYtTi7TVhU1MSSgQrLAxgwU+F+ox46RnbEgzq2imPT1EWLyxl0q76W5 vnMcVCCL5foGsBFt9r6zFfVud1idffp6ypBeR5++SpmFNqH8kOq5hSMeMoScO+8uJy68 28jsLrHwPJQ6ST44hhBkWGwnOhNKjkrFjEiQwiA3/lNVRdBXiAN9mTCysmC7lNiS9IE4 /+Jg== X-Gm-Message-State: AOAM530TQt/dZj+0OZ18vti0NEljx4ZvqeEZDhw5/3Ir7tg1Rqnv5/5S dIYLQKrQrUWICOLmKf4aDB2THi4ITN5ToAlFRWtwJ4PocKGfMQ== X-Google-Smtp-Source: ABdhPJzNijljh6irJCa0AnZcTHrmSoPvS1sbsyv2Da1Q3Ru5elIUp7+t1hn7F+RPKe8ZfVQFr0PmFB9T3D2NHzy+LkU= X-Received: by 2002:a05:6512:23a7:: with SMTP id c39mr12932407lfv.655.1638456511166; Thu, 02 Dec 2021 06:48:31 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 2 Dec 2021 14:48:19 +0000 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000540ecd05d22ae295" Subject: Allowing NULL for some internal functions From: craig@craigfrancis.co.uk (Craig Francis) --000000000000540ecd05d22ae295 Content-Type: text/plain; charset="UTF-8" On Fri, 26 Nov 2021 at 16:47, Sara Golemon 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 `` 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 --000000000000540ecd05d22ae295--