Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117163 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 3919 invoked from network); 28 Feb 2022 15:19:57 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Feb 2022 15:19:57 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 69D43180505 for ; Mon, 28 Feb 2022 08:40:58 -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.3 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, 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-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (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, 28 Feb 2022 08:40:55 -0800 (PST) Received: by mail-ed1-f43.google.com with SMTP id q17so18431051edd.4 for ; Mon, 28 Feb 2022 08:40:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=PWBUpN6hed9IFdbm4caDBugVppjdXPfCxSeN23yT67k=; b=WA+BAtaJh/sxuCw5cEjQopG8OfHkdEBnkmOA7yfNOO+a2fAv6NM/Yse6ArWH9LhAGr RMGmz5HGphFLPpVY79TTA4mCi1z5+kz93/YmX5UZG+DP2Io/4rO5sjN7Sjr3cqGKEUJv jZctz706P/cmHxskkmCqOEsl8yQuZltF82NiDSjIG7x3MDQTFgaTeVmDw6OgmG9Ih+I1 8Srj7rDu612pcdepTfFAYFTtXJeL1q40x+6sxR48jgB1qgiNOEnBwUAo/+75R5e+XOs+ jmAXogEZl0qbbj6OyRsrpupbuU5WC4JueZPCx35e16dsGmXbEJmbHhl66Oc0lzw9LSGj NOtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=PWBUpN6hed9IFdbm4caDBugVppjdXPfCxSeN23yT67k=; b=bGl0fY4JvpN4rDJ8CPQiwUHVW2v5gKj7KWtWvk4Cw3vlVOkrAjX76oYsZZUwQgNxhm dT4exXwfhrrRsgTrznhP533PIojhDCf+2cNBRDlRCuwI7QKw9a0kMOanZnEPQTeB7h75 gMD5WIZ+dB+dVbctSoiPB2ihNdgb5vI1vKOs5fzvmw6wg/HDsTNc18Z0loJ8asstKO1g 5xcJL4OrM7Z3nJauttKRQO+iVJ9gDZiksdO5YJrdOVKZSkQezPBP4WhoseyNOMN4uLKw uPQH0d78XHpWWQ5A2FofzBejAzWXnFth9Ii86hSpg0yw4OoySWxyP2kUqTt4ivwJgkSP rhaw== X-Gm-Message-State: AOAM531fyj/tCb02Mx6FA/VpLCWW1IUpw0tJyYam5VSkQpUcgXIMvJcz j5QfHmxtRxEjeUxrme3OxXjII5flBaY= X-Google-Smtp-Source: ABdhPJxErHv5rtpGG0IadmNVEWRVBvM9kGphEs2P+gftCRmdkfO06AvzzcYP5jZaGIKHGYkrdEXewg== X-Received: by 2002:aa7:cb96:0:b0:413:8d05:ebc with SMTP id r22-20020aa7cb96000000b004138d050ebcmr11654963edt.81.1646066453746; Mon, 28 Feb 2022 08:40:53 -0800 (PST) Received: from ?IPV6:2001:983:6fc5:1:5400:d9f2:b79:86cf? ([2001:983:6fc5:1:5400:d9f2:b79:86cf]) by smtp.gmail.com with ESMTPSA id n18-20020a17090673d200b006ce8c6774c3sm4531408ejl.135.2022.02.28.08.40.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 08:40:53 -0800 (PST) Message-ID: <5494eaa7-2fa6-8364-9683-a2c8c9789d81@gmail.com> Date: Mon, 28 Feb 2022 17:40:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Content-Language: en-US To: internals@lists.php.net References: <983552d8-11f1-b5bc-fb82-148347982fda@gmx.de> In-Reply-To: <983552d8-11f1-b5bc-fb82-148347982fda@gmx.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Allowing NULL for some internal functions From: dik.takken@gmail.com (Dik Takken) On 21-02-2022 10: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: > . As of PHP 8.1.0, internal functions behave > the same as userland function in this regard. > In my view, consistency between internal and userland functions brings a lot of value, and not only for the language itself. As soon as internal and userland become fully consistent it will become a lot easier to write "internal" functions in PHP rather than C. Not only will that make developing the standard library easier, it may also make the optimizer and JIT compiler more effective. The more consistency the better. Approaches 2 and 3 from the RFC are a step in the right direction. Regards, Dik Takken