Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116991 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 42531 invoked from network); 7 Feb 2022 10:49:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 Feb 2022 10:49:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 533671804C3 for ; Mon, 7 Feb 2022 04:05:16 -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.6 required=5.0 tests=BAYES_50,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-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (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 ; Mon, 7 Feb 2022 04:05:15 -0800 (PST) Received: by mail-lj1-f174.google.com with SMTP id t14so19210497ljh.8 for ; Mon, 07 Feb 2022 04:05:15 -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 :cc; bh=vM/IXUi1pfsgwHRqsgD7xrmkiUNSa7DfDDWniyYiuSM=; b=DP2iONvnvvs8DiKWDhwttJfeyGFEQWbjt+JCoQpTjmQ+UsncV7uIkKLDa3E6YV0DR+ pElbIwCfZ1Sw8/R1bjxvBVhj5BMMMXPnBC0MuE6zDbIUXTFiHjfQkLaz7yCG8TXE8wwn NXjnD8OiaBYVLqNQnlbMWJNlfNfsce3fYM5bI= 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:cc; bh=vM/IXUi1pfsgwHRqsgD7xrmkiUNSa7DfDDWniyYiuSM=; b=2KCb3dwyrpas1MZ0hZg515q7w1lAsdOAtHoow3HGNSbQTdEXqLy4pT/672/IdeV9n0 O2Rf8bDMAxeyvtKdGFJVi9sR3fVrdswVsuW5zEMGMbQG63e2vwAKBsLMTiu2yIDJbV8Q NkJOTcYtbjd5wIy23p07IrLRR1ltvCoeOefufq+GX61ol9h/q5wNmbbbRpavg6Oa6Yov xoq1KQ9lmCaLiP//+vFH0rlCAwx44IztdNqKwb/tT3LxdcPaWuaHs+ZzRM71ihWeVzzS NRkm8DIgRA/bBzR7ev3d0LkmJCyBNtlKu196f3lNRDweJNmu0hSXSHm/r/ioiE1xY6U9 lZ2g== X-Gm-Message-State: AOAM530VyB+XAoZeOgBJ5G7eSuIftb8pv1vKzPTwzLp+yaU6EuE65yRY tyLX0l17X4VjQkfD44y9RwQS6XQAipCMx7ftxFCjSw== X-Google-Smtp-Source: ABdhPJwsPCBJw6Q7dazs058BTx2+XseXXHcqn56gB93GX6P780UYUCwpaieDKaTrfsswh56cS5D7xjgQ+XnAFq1URzA= X-Received: by 2002:a2e:3212:: with SMTP id y18mr6859000ljy.27.1644235513983; Mon, 07 Feb 2022 04:05:13 -0800 (PST) MIME-Version: 1.0 References: <6200d9f4.1c69fb81.1d3f2.8b60SMTPIN_ADDED_MISSING@mx.google.com> In-Reply-To: <6200d9f4.1c69fb81.1d3f2.8b60SMTPIN_ADDED_MISSING@mx.google.com> Date: Mon, 7 Feb 2022 12:05:00 +0000 Message-ID: To: Mark Randall Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000bd06fe05d76c6945" Subject: Re: [PHP-DEV] Allowing NULL for some internal functions From: craig@craigfrancis.co.uk (Craig Francis) --000000000000bd06fe05d76c6945 Content-Type: text/plain; charset="UTF-8" On Mon, 7 Feb 2022 at 08:36, Mark Randall wrote: > I understand your motivations in proposing them, but to my mind it goes > against the direction that PHP is developing, which I think is the right > one, where errors and likely errors result in stopping execution rather > than allowing it continue > Hi Mark, Thanks for responding. I'm not completely against this approach in general, but I'm trying to find the right balance. Back to my example; most frameworks return `NULL` when a user value is not provided via GET/POST/COOKIE (this is a useful feature), and many developers simply pass that nullable string through to functions like htmlspecialchars(), urlencode(), etc... I do not understand why this is an error so bad that it must result in a Fatal Error for everyone using PHP 9. As noted before, I can see how NULL might represent a problem in projects using `strict_types`, but I'm not proposing we change anything for them (also much more likely to be using static analysis). And specifically with NULL, strings in C are a "one-dimensional array of characters terminated by a null character", so you could say that NULL is very similar to an empty string - maybe that helps address the "pretend its a string" objection? Craig --000000000000bd06fe05d76c6945--