Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122237 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 19984 invoked from network); 24 Jan 2024 03:35:38 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Jan 2024 03:35:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1706067382; bh=K0UsXry8u0/7Pxw+5vi+fanu4pCcy4fXBH6ccMxijJs=; h=Subject:To:References:From:Date:In-Reply-To:From; b=TpSry2UUSAlXzmz7UJjioDGlkRTg439/5sBmWWxmQbaRI4MERS3BhapiQVECeuXQY lqoMxdfeAVkiNckxtucN1Gjn/QbVzxBQ+Tc17fh9K9TUK2uPGk3DIDxjgjhvKrngVg rr39NVguMYx3h140Fi0GiA2LyIPOmOhKLF+wYXR23rMiyt9UQtO5/WpIc8zkRVF63S mHKQPDxKDaAwztpWCOMyemQJetSpPYmw7SAupDVzDXgiFMjWdeRtqAB4K2U003qgSF ExPQhK81gxVJ0KPzxVBzFJ1e3DfzFP8zzDgs3/4pSxbguYMav+dCvV+Mz1cztXA1cW ECPjJlhweQf1w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AB34A180051 for ; Tue, 23 Jan 2024 19:36:20 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING, HTML_MESSAGE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_SOFTFAIL,STOX_BOUND_090909_B autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from insect.birch.relay.mailchannels.net (insect.birch.relay.mailchannels.net [23.83.209.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 23 Jan 2024 19:36:19 -0800 (PST) X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 90151C2864 for ; Wed, 24 Jan 2024 03:35:34 +0000 (UTC) Received: from nl1-ss105.a2hosting.com (unknown [127.0.0.6]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id CC5C4C26BC for ; Wed, 24 Jan 2024 03:35:32 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1706067333; a=rsa-sha256; cv=none; b=6ddnaACM6lVanLTpC/TfujaJad5bq5jNJUCwGyQxIuZNXLXKaA1F2kj3TiSydrimpMWckh KKo6sExuMNkvRMjiC5ipXr4qJn/m+mt/xrGQI6/Z4OfD7JLBz6XXUmmggzqMBOVsVP96Q0 3/JRIzAEpdHjzyVPRMhVAN+zpKhogEJ85KdIljfH8lcPJC7/2Rla9Emph5h5tituCWlQCh RmPCwEu1jxbK0JKy0Q38hgC5GJ7pYW+ia7n3RO1XEbRNVgiNBwwIRvC9qsxqP9s0yKB6XN zutIzdngzr0vGkDcPfskgo/78CBVcHN8A/6t8tqxRiyZjt2gurFrMK6Rgb0qHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1706067333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RrR2RKOpaXresHuXKOmGlLiEXKYOt6Oc9VIrG7M/m4k=; b=fCuRTU7q6nur0PJyCtCNhaajPEWtm2kZW53M35WQo4lySKOMBqpduSKW4wZQ0Y5jrVxVZb +auWF0Qz/yKBWO3Anjd6b6cDTRIUQb2Q13cS752dytsfm0PPkHrlVSTp1m3KV7q0pisCmQ uPIkMwT7EF9AvlbtNg0zkLOWqVHcaoRnDFkd/XmMGMMCZhgU3q4MZanWi4CpwjeNVdi2xo rsSmFwk5xUfYNVmBOcXY1zSh2eEDsGES0Jtku2wjBVNyYiAG9sAfT8VQovqq5JOIis1xuK iCN4jtpSKzjfDoaUaWJQP7zH5EYaFmN+7tHDzsCIK9HQX2Jj2IP2GSklVR7ZUQ== ARC-Authentication-Results: i=1; rspamd-76cc9994fd-d7dch; auth=pass smtp.auth=a2hosting smtp.mailfrom=php-internals_nospam@adviesenzo.nl X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|juliette@adviesenzo.nl X-MailChannels-Auth-Id: a2hosting X-Harbor-Thread: 03d5e8596610276d_1706067333405_771705138 X-MC-Loop-Signature: 1706067333405:2598059161 X-MC-Ingress-Time: 1706067333404 Received: from nl1-ss105.a2hosting.com (nl1-ss105.a2hosting.com [85.187.142.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.100.20.137 (trex/6.9.2); Wed, 24 Jan 2024 03:35:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=adviesenzo.nl; s=default; h=Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=RrR2RKOpaXresHuXKOmGlLiEXKYOt6Oc9VIrG7M/m4k=; b=HKDfsBK1691sxKj42PYUOAv0Id 2E6AxrOBTYFInbCX4bXmMYSseLAuRrU6AigFcnRnQwbxdvR6WRkeC1bpFFO+gmr5fJOSheDzG/blg BKAJLTj5ah6uYGh0WLMzBqGoBBa497SEzAq14psJ0IOcyroQkl81p50x7Qq2/9jut+VU=; Received: from [143.178.154.86] (port=61913 helo=[192.168.1.16]) by nl1-ss105.a2hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96.2) (envelope-from ) id 1rSU30-00E5mc-2g for internals@lists.php.net; Wed, 24 Jan 2024 04:35:30 +0100 To: internals@lists.php.net References: Message-ID: <65B08579.6000801@adviesenzo.nl> Date: Wed, 24 Jan 2024 04:35:21 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------090102070402060904040007" X-AuthUser: juliette@adviesenzo.nl Subject: Re: [PHP-DEV] [RFC] Deprecate implicitly nullable parameter type From: php-internals_nospam@adviesenzo.nl (Juliette Reinders Folmer) --------------090102070402060904040007 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 22-1-2024 10:50, Gina P. Banyard wrote: > Hello internals, > > Máté Kocsis and myself would like to propose deprecating implicitly nullable parameter types. > > The RFC is available on the wiki at the following address: > https://wiki.php.net/rfc/deprecate-implicitly-nullable-types > > > Best regards, > > Gina P. Banyard > For what it's worth, I support this deprecation - one less "exception to the rule" to have to take into account and remember. As for the RFC: * While I don't think the impact will be that large and the fix is straight-forward, I believe it would still be good to include an impact analysis (top 2000 Packagist packages check) in the RFC to confirm this. * The RFC currently only talks about deprecating the syntax in PHP 8.4 and makes no mention of removing support for the syntax altogether in the future. Would it be an idea to include a proposal for removal of the syntax in the RFC ? * The RFC does not mention the impact of the function signature change on inheritance. I think it would be good to clarify that there is none. The changes will not cause an LSP violation in case of inheritance and can be made for parent/child classes independently of each other. Also see: https://3v4l.org/0qM7W * While the majority of projects will (hopefully) be able to use nullable types/union types with null to mitigate the deprecation, there are still projects which have a wide range of supported PHP versions with the minimum being below PHP 7.1 (yes, WordPress I'm looking at you). It might be worth mentioning in the "Backward incompatible changes" section what the options are for those projects to mitigate the deprecation. As far as I can see, that would come down to the following options: 1. [Best option] Raise the minimum supported PHP version to 7.1, use nullable types and remove the `null` default value. Including a code sample like the 3v4l I posted above should probably also help clarify the expected change to the code. 2. Removing the default value without making the type nullable. This would be a signature change and could cause problems if the parameter was previously optional, but that's for the project itself to make a judgment call on. 3. For scalar and array typed parameters, changing the default value to one which complies with the type. Again, this would be a signature change and in this case, it could cause problems if the parameter was previously required and not the last parameter before optional ones, but again, that's for the project itself to make a judgment call on. 4. Remove the type declaration + if the parameter is/was required, remove the default value. This would be a huge step backwards, but would still allow for making those signatures cross-version compatible. This again, would be a signature change and this would be one which would violate LSP in case of inheritance, but again, that's for the project itself to make a judgment call on. Hope I've captured all options, though not claiming completeness. Hope this helps. Smile, Juliette --------------090102070402060904040007--