Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117510 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 83437 invoked from network); 11 Apr 2022 10:34:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Apr 2022 10:34:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E123B18037E for ; Mon, 11 Apr 2022 05:05:53 -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=-2.1 required=5.0 tests=BAYES_00,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, 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-yb1-f173.google.com (mail-yb1-f173.google.com [209.85.219.173]) (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, 11 Apr 2022 05:05:53 -0700 (PDT) Received: by mail-yb1-f173.google.com with SMTP id e71so12514139ybf.8 for ; Mon, 11 Apr 2022 05:05:53 -0700 (PDT) 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 :cc; bh=r0/PXApNTm1eafb79D+jBeHLbIzUyWDHQppsmcxkgxc=; b=iTbtK5UaNXBevGnIRvDomngnUHGkhHayfEYOV5wi68gUlOAk7e2z7MLuFhGCjpiLq9 mBer550Uezfn+BF+ZUMmgYkzhcfyhLIgZLnYxf1VUDZ1tj1gYXuzskA9A0AbIAFRFBQY mfLshK0SlSdQkWAtHfauJt285VWpfsFFjBMqR5BCIP5K6Fhl/fMx2Vi0xr98afAK+L2/ qKy6MJx/l+cKmU+AggZ9JiwZrldBCHtaK52+wsibl0ieQkQdqXnj9IlEGJqnO+8+OjAl NcD2nuQNb6FSkBmBOtC/XIsNNsXAIRmD8C0Jg2pDVNSNc0aDHowHhQ5J/PUqBOQgRkhV ASqw== 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=r0/PXApNTm1eafb79D+jBeHLbIzUyWDHQppsmcxkgxc=; b=Nt10FzSXbK6f//64J5Ge+UF+QAsirWsmt+2+AAUwLvycKEh2o/9GBpsImgubLWjQQH 6rGubepoUQgOFfwYn7iyJt6kzgFu5kLlVJUDWAfwkx2U3wdWxizKA3q1vvKSZ9oXQRl5 j2KJG0EaCNj3ADFa27Xx3ZFzMXZ0WwO91vHlwJp1hfQstQL8EFDSzUscqTFLi6sgS7PF fpKKD9ALeSauvsOBMkHpSWUoQxDBep8JmKV+a7glkIwGhfGVEsl+QB9UPAHU9lR1nTV2 tvanusYFSiBIX9WxZ89E0Qb43wz+bWfW4eIHobdXu8um1Ub0lKsRHdx71Iev+URUTke2 P0zg== X-Gm-Message-State: AOAM532Nz16Hl961WD12tGJdqnrhaT7TDWhA6AFjMx0mInoNcWStiyXy MWjhfvh0kPs2R7cj+7T0hC+CTcdrInxfx8cIsGyb56OP3g== X-Google-Smtp-Source: ABdhPJwLoKp3ZrWtTqqlz+B9f37JpMF8V7FhTIoyoL9swxCrtWlPdyaNnvUEg7sDb3461G1zQ2Pjic8DUKbjF3B3crk= X-Received: by 2002:a25:a029:0:b0:63d:f892:e7af with SMTP id x38-20020a25a029000000b0063df892e7afmr21252191ybh.14.1649678752692; Mon, 11 Apr 2022 05:05:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 11 Apr 2022 14:05:41 +0200 Message-ID: To: Craig Francis Cc: Mel Dafert , PHP internals Content-Type: multipart/alternative; boundary="0000000000000c3bce05dc5fc476" Subject: Re: [PHP-DEV] NULL Coercion Consistency From: guilliam.xavier@gmail.com (Guilliam Xavier) --0000000000000c3bce05dc5fc476 Content-Type: text/plain; charset="UTF-8" Hi, > https://wiki.php.net/rfc/null_coercion_consistency Thanks for the draft. On Sat, Apr 9, 2022 at 11:30 AM Craig Francis wrote: > On Fri, 8 Apr 2022 at 19:07, Craig Francis > wrote: > > > On Fri, 8 Apr 2022 at 18:54, Mel Dafert wrote: > > > >> In particular, does this propose changing user-defined functions under > >> strict_types=0 to accept null for scalar types? > >> > > > > With user defined functions, I think it's up for debate (still a draft), > > but I think those NULL's should be coerced to the specified type (as > > documented), where I don't think PHP should be doing type checking under > > strict_types=0. > > > > > I've updated the RFC to note that user-defined functions don't cause a > backwards compatibility issue; but I have added an example to highlight > the coercion inconstancy: > You've updated the **Documentation** section (also: did you mean "inconsistency" rather than "inconstancy"?) but still not the **Proposal** (BTW all those sections between "Introduction" and "Proposal" would probably better be *sub*-sections of a section named "Problem" or "Current State" or something). And for the question: (currently) the RFC is named "NULL Coercion *Consistency*" and the Proposal says "Must keep the spirit of the original RFC, and *keep user-defined and internal functions consistent*.", which (to me) implies *not only* reverting the 8.1 deprecation on internal functions *but also* "changing user-defined functions under strict_types=0 to [coerce] null for scalar type[ declaration]s" indeed. In any case, that should be written clear in the RFC (either in "Proposal" or "Open Issues"). Regards, -- Guilliam Xavier --0000000000000c3bce05dc5fc476--