Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117164 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 7468 invoked from network); 28 Feb 2022 16:14:20 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Feb 2022 16:14:20 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B9B911804E3 for ; Mon, 28 Feb 2022 09:35:21 -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,FREEMAIL_FROM,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-yb1-f170.google.com (mail-yb1-f170.google.com [209.85.219.170]) (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 09:35:21 -0800 (PST) Received: by mail-yb1-f170.google.com with SMTP id u3so22028830ybh.5 for ; Mon, 28 Feb 2022 09:35:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=ai/qAnhIGpZfTDYo/E8pSgQ0STCHi4RQyUv8XrXy758=; b=amYkA+fd8Ush2QtGoUwT8I+YpvTZilXoR3tikbM8A/XcfYiWU7ShiHLl1LbWuwDbVN q1crJWl7zFUsso8R7eM5zYOz72Al3XalfpLWcF1pMLqea6A7LENxVK2v3kizDDD59m6M K7ellDVffZJiUgR64AxVClwPFGjMUlK7bqKevVAWuOdY8EiJWc6flFUmM33zfxeiZlnB XbnfFMdIzSYHJYlHZSKtq7+MZeNzJRdtbZzMCix4bRgtXEnxObq/fPR3HAfK6WZmEwAu aBKYh2SP9I4kn1TruTOP0sBH4oJx6YjMokQnsnMAfniJ/rFGVTJpUf6tiM+6D6CkrzT/ pQAQ== 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=ai/qAnhIGpZfTDYo/E8pSgQ0STCHi4RQyUv8XrXy758=; b=4/cFrbw3mcDPNAQtacr+MksBMn/p5F6wJZVBdZsTFlbrriB6Af1COyj+JMPoQdl89m AqJpK1ZFSIyt6l2djETu41hgaT7LS75cvx0kFHWchg3+u7sKfxAvIS2zUP7rO3IPrmUP LUX2ebvl98aFKWjXRYpk4XSLx+0p2rCZz3lh0KarpRoyhOof9yxgMAGuwOaOZ4icbO9B T3dotc2o1HhBC4xSZnGoN3f7i+xwkOhppcu2YVsbcrJfH0mFwPug+BJ4v1zwP4+iG+/V MPs4j58Yszd3Lg+5Ph0m0ueACdqBukelshUSb6pwnWG+2ZZxXIYE2vuvjRx/c64SMMgC 8pHQ== X-Gm-Message-State: AOAM531IN9etKH3uv+vNRTtQ8ulJgjfGjC78kD5tYxeTvZYPr5H4dtWQ PitZfeGNJYRf39SBxXlc4IyMcg2Xk1aOmy+xemVIxhgwCw== X-Google-Smtp-Source: ABdhPJyZDhe9xeSxwFM5936xrR81rybM1moYlitzs5FLtRgPly9wwsZt1psLTupbKUkXQaSsh8/HzchMZgv4eDTYgBE= X-Received: by 2002:a25:da87:0:b0:611:aa55:c37c with SMTP id n129-20020a25da87000000b00611aa55c37cmr19242687ybf.9.1646069720761; Mon, 28 Feb 2022 09:35:20 -0800 (PST) MIME-Version: 1.0 References: <983552d8-11f1-b5bc-fb82-148347982fda@gmx.de> <5494eaa7-2fa6-8364-9683-a2c8c9789d81@gmail.com> In-Reply-To: <5494eaa7-2fa6-8364-9683-a2c8c9789d81@gmail.com> Date: Mon, 28 Feb 2022 18:35:09 +0100 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000fb494105d917789b" Subject: Re: [PHP-DEV] Allowing NULL for some internal functions From: guilliam.xavier@gmail.com (Guilliam Xavier) --000000000000fb494105d917789b Content-Type: text/plain; charset="UTF-8" On Mon, Feb 28, 2022 at 5:41 PM Dik Takken wrote: > > 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. > Yes, and we see two possible ways to make them consistent w.r.t. handling of null argument passed into scalar parameter: 1. implicit coercion by default, error with strict_types=1 2. error (independent of strict_types) AFAIK, internal functions have been doing 1 since like forever, but PHP 7.0 chose 2 for userland functions when introducing scalar parameter type declarations (see my previous message for history) and PHP 8.1 continued in that direction by deprecating 1 for internal functions (and planning to change them to 2 in PHP 9.0). Call me devil's advocate, but is it too late to discuss revisiting past decisions and consider changing direction towards 1 for userland functions (esp. in implications of BC impact)? Regards, -- Guilliam Xavier --000000000000fb494105d917789b--