Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117101 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 10988 invoked from network); 21 Feb 2022 14:12:43 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 21 Feb 2022 14:12:43 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 647E41804D0 for ; Mon, 21 Feb 2022 07:31:57 -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=-2.1 required=5.0 tests=BAYES_00,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-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (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, 21 Feb 2022 07:31:56 -0800 (PST) Received: by mail-lf1-f50.google.com with SMTP id j7so19337223lfu.6 for ; Mon, 21 Feb 2022 07:31:56 -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=s7PYW/LmQMNfW/I/so8ogAsfbmUNiBbu06pWMI0dBTM=; b=P6Pg0VoADUnEcfT4MGEQDchTgBHwinwhi0ct0XsF8fALw1entm/Hs6cphZDmUce7US BE0NjaLt3cV4n+xAqV3etb0MC9a5XwQlRtRL3Vg+yS8TyjEla/gpy3EIESNzOBIuAL/v VchE10+TDJ7NAHCk9IKpdRutCmnxm8Vn7j4xQ= 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=s7PYW/LmQMNfW/I/so8ogAsfbmUNiBbu06pWMI0dBTM=; b=eiRV3ujxd2xs3sNmkyAFMrRrfbHap/G00YNAx/CVBmSJRDL+wivWOdgb3PcPp2ArRu W5eLMnxB2g1Yjofvk8EZ9PxGXhyRMuz8C8iUgUC/obFapsGgExRxGrwXUTiSdVOw6VYR bdKMYYjirS0sgVs0dfbpQ943ixuJbkC2GMvHQd2/8MKMEPl7cSLl9RGB8uzDcb6v0V+X IiZLU8W+X4Xowrw8/ncOzlvpCOv19/mSa9F2xuiR1fx2BPB95Q0os2hJQD4JIrzdIMAI HRdLNMmN6mBImPtI2f5mv1ZyLK/7KzgfQ3rOEVD+gtDgX5hJQH9ftS7tEP9kndI028SM 8GkQ== X-Gm-Message-State: AOAM531o3j//IGANeNwSPx1BrbjsTkEmNuFJ5m95nb9hhoyRvHaHlt/T OeGvSfZ4t33C1nmyF6qNVJWU/x9PaX3IXBzb4q5ebQ== X-Google-Smtp-Source: ABdhPJxcgVAfMfqosMCyND6MyczeRhvZyfKa0WaY5DGVXOjSIo+LGIBpYkcvHp3z9TjUv3kGKNqAMxjqAz7MPUpecCE= X-Received: by 2002:a05:6512:e8a:b0:443:7b8c:579a with SMTP id bi10-20020a0565120e8a00b004437b8c579amr14479792lfb.687.1645457515186; Mon, 21 Feb 2022 07:31:55 -0800 (PST) MIME-Version: 1.0 References: <983552d8-11f1-b5bc-fb82-148347982fda@gmx.de> In-Reply-To: <983552d8-11f1-b5bc-fb82-148347982fda@gmx.de> Date: Mon, 21 Feb 2022 15:31:41 +0000 Message-ID: To: "Christoph M. Becker" Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000af9b1405d888eea3" Subject: Re: [PHP-DEV] Allowing NULL for some internal functions From: craig@craigfrancis.co.uk (Craig Francis) --000000000000af9b1405d888eea3 Content-Type: text/plain; charset="UTF-8" On Mon, 21 Feb 2022 at 09:04, Christoph M. Becker wrote: > That "inconsistency" had been introduced with PHP 7.0.0, i.e. right when > scalar type declarations have been introduced. Passing a null to a > non-nullable parameter of a *userland* function throws a TypeError > Thanks Christoph, that's a good way of looking at it. Considering NULL has been passed to these internal function parameters for years, for a variety of reasons, and PHP has coerced it into an empty string, integer 0, float 0, or boolean false... I'm wondering if my RFC should focus on matching that expectation, so anyone not using `strict_types=1` does not need to make loads of hard-to-find/unnecessary edits; that way NULL would be treated the same as the other variable types (I appreciate arrays and objects don't get coerced, but I don't think anyone expects them to). Craig --000000000000af9b1405d888eea3--