Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117528 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 95613 invoked from network); 14 Apr 2022 06:55:38 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Apr 2022 06:55:38 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 74BF818037E for ; Thu, 14 Apr 2022 01:27:48 -0700 (PDT) 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.7 required=5.0 tests=BAYES_05,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,T_SCC_BODY_TEXT_LINE 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-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (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, 14 Apr 2022 01:27:48 -0700 (PDT) Received: by mail-lf1-f46.google.com with SMTP id x33so7849862lfu.1 for ; Thu, 14 Apr 2022 01:27:48 -0700 (PDT) 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=RV1KiFJUIRFDqTXqPkjNusAHrxH3jWaSeACIvq02IwU=; b=A/k2fCvtOkMi7IE6uPx+eBc8EaQN7HYsyQlMN8nT7eLtqM2P7ZGo0WfqC14UhlDotH oKPfqnXg/37nOzY4xWspsFKxprvNGo0zFTOXeirLBqDOFtFvc0iAA8ez9JBqAZpw1Rxw 1bALWuc31ARZJNj5+07wcRoIVEd5QYv1B65I8= 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=RV1KiFJUIRFDqTXqPkjNusAHrxH3jWaSeACIvq02IwU=; b=mLbs6hZeU3T3aTNOel3YFigV5ub8g6xwq2oS5DxCgLYUL2UGM1jTEz1jNj/4nXJqbn 85lU9zodwL0siit/dzCZ81zQ7kzFLzosx5HbP5v70uy6sGz8XbH9jDPv2RJuEPKAi3r6 IOU+OUZcozLv0VjuOL5rV9EU2KlipQlkGa1BW7wg0duTwx8EB3196REZhEhi9w0+CRn+ 2F+f+AZtg4UARz1OtuNR4GRNFjybWeNBkMLAUHs2rNYLtVuNrTC5QotFWK4PChtFGIT0 sLNmgsHaXWft6z4mo2uAK7muK+gKA4dr86N7/yPzRWQavBwotB52F2INIC7IHfbwbac7 bK4A== X-Gm-Message-State: AOAM532eb8NZlLD0sVrOz3jYDKEh3zw8NSIBPafIR9mb4YVuVsALax3+ xUtPSIsBUjM1UG8n7rRCvBus7a1D1xkCBHu1f9teuA== X-Google-Smtp-Source: ABdhPJzZMuVRPXQ4UAlfAdv3E0B4a24bM52HW/GcQ++ECBzvoFTVRvGuX5WNpxloevCqEHyOw2hYGit8gcN1XzDt21k= X-Received: by 2002:a05:6512:3e1b:b0:46b:a4d3:7da1 with SMTP id i27-20020a0565123e1b00b0046ba4d37da1mr1242167lfv.302.1649924866403; Thu, 14 Apr 2022 01:27:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 14 Apr 2022 09:27:35 +0100 Message-ID: To: Robert Landers Cc: "G. P. B." , PHP internals Content-Type: multipart/alternative; boundary="0000000000009184ff05dc9911ff" Subject: Re: [PHP-DEV] NULL Coercion Consistency From: craig@craigfrancis.co.uk (Craig Francis) --0000000000009184ff05dc9911ff Content-Type: text/plain; charset="UTF-8" On Thu, 14 Apr 2022 at 08:31, Robert Landers wrote: > > I see null as a real type > > This confuses me... Andreas is probably the best person to explain their view; oddly I see NULL as it's own type as well, because are there are times where it's useful to determine the difference between NULL and an Empty String; but when looking at examples like user values (e.g. GET/POST/COOKIE) being checked (e.g. `strlen()` or `preg_match()`), encoded (e.g. shown on a web page with `htmlspecialchars()`), or simply modified (e.g. `trim()`), I don't see why those possible NULL values should lead to a Fatal Type Error (unless you are talking about an environment that uses NULL as an invalid value, but I suspect that's quite rare). I see this RFC as a balance in that regard, because real life is > messy. I really hope it passes and good luck! > Thank you Robert, it's right the balance I'm trying to find. Craig --0000000000009184ff05dc9911ff--