Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125357 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id DF6901A00BD for ; Fri, 30 Aug 2024 08:12:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1725005656; bh=QU8Q3d7tfbvrhi1Jt+UNM4eto1XoqocjWNb31MLC6xw=; h=Date:From:To:In-Reply-To:References:Subject:From; b=ZuLxgpy4tRDHHaMhsKU2QVXJThiULabbd/nqpyPeEmfMMewSV4SjSHF9OllMZFVhV jM7Neu52IHh6A+qjCgs7mVgBZaSd9JwtE7TtYKJR/LCgS0x0KUimDIl7JUvXQfHzyj 5FoLsrOqu6cR3+lD/gRPb87vRBH42sLtiIW2rRVYUEKIIit2sGZvERt4UaxYNb7dNL vFPeIVKvHpFad5XWljLrjCfAvntYQ29C25MzKNP2yiX0ZuBERul89NGfG5vu56kMWM tqh6MPiYyNe0QYCtfY0BlRV/EF7h7BcrfOuJle5z2zlYjcQHRWXCMUhD8oIw4gKLZI E5gtHY4FG33Ug== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 597AF18005C for ; Fri, 30 Aug 2024 08:14:15 +0000 (UTC) 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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fout7-smtp.messagingengine.com (fout7-smtp.messagingengine.com [103.168.172.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 30 Aug 2024 08:14:14 +0000 (UTC) Received: from phl-compute-03.internal (phl-compute-03.nyi.internal [10.202.2.43]) by mailfout.nyi.internal (Postfix) with ESMTP id 79A3513801DC for ; Fri, 30 Aug 2024 04:12:19 -0400 (EDT) Received: from phl-imap-10 ([10.202.2.85]) by phl-compute-03.internal (MEProxy); Fri, 30 Aug 2024 04:12:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1725005539; x=1725091939; bh=IBMEKquSYpw9IysB54Q15NQNrwm/LEGJ3VVnebmfqCg=; b= MIY+wRz1t8H7Z4m7+Z+LurkNlSoX+qZKFtZaXKFyz7zhZviF5+4QCopPOMXauG90 uPYWSTKMnc/Nu1HRKs/tcdnE3v+GgjQ67DWqVWpflstXZfd+hdaBIrIHjIiNsWiw O8TL3Y2aGcVDMPwoNEs041ZPQaDzc6rfaxbDzRHXnXGLuYp3gxmYo7DyeU5HPN2n yIoW4vyxAycXkAjS/fLVGXOqjn/Q7KHN71vHSX3bzeVr8d/vaLTPcPaHQ1U82n/b C0Fv6Zr4oZWLrVWw7uw0gsd0F1EaNrKo2AEiIPLCusRXlVZstvRI8L80EzIeaSyY l9/gwPLmocye8uWqTLz6rA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1725005539; x= 1725091939; bh=IBMEKquSYpw9IysB54Q15NQNrwm/LEGJ3VVnebmfqCg=; b=g LBnm4x13JiwM1y+v2++6y1lrWjUum0kbZT6wgcD3YypzcMUXJxt7ovmaP3hnPx7c TYjQj1vZeAtk8wkMNAQ8pLmALgiMw21KzYxE+l7GBWHFZmdwCSn2xVAEAwW3Frqd Zu9WnrVa8zZcGC+WGUl3S3Tn3n9810C/gqo1daTmjHf3Zocfbh7gRrpPKSigeAHK sEY6H0TEo9cY58It9SY/ngFf5+0ct34BYEXl/taV/Q/SM5C9BZ6OMmg4ERvR7cys K7ilU0tUlCFRaKEIJjB1YTb5JfTT4PXdOZELjrirllU35CzfjWKFUl0gCJu+owdm SwsFDl3InreBwliGE+RgA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudefiedgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefoggffhf fvkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedftfhofigrnhcuvfhomhhmihhn shculgfkoffuohfrngdfuceoihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqeenuc ggtffrrghtthgvrhhnpeffveeuudehvdehieetieehjeeliedvudeigeejtdfftedvueeu lefggfethedtffenucffohhmrghinhepphhhphdrnhgvthdpghhithhhuhgsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihhmshho phdrphhhphesrhifvggtrdgtohdruhhkpdhnsggprhgtphhtthhopedupdhmohguvgepsh hmthhpohhuthdprhgtphhtthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhn vght X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 367CD3C0066; Fri, 30 Aug 2024 04:12:19 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Fri, 30 Aug 2024 09:11:57 +0100 To: internals@lists.php.net Message-ID: In-Reply-To: References: <0c8ed5d6-5507-4c41-8d7f-05d14ba8aa4c@scriptfusion.com> Subject: Re: [PHP-DEV] Re: [RFC] Default expression Content-Type: text/plain Content-Transfer-Encoding: 7bit From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On Thu, 29 Aug 2024, at 22:52, Bilge wrote: >> New RFC just dropped: https://wiki.php.net/rfc/default_expression. I >> think some of you might enjoy this one. Hit me with any feedback. >> > Now the dust has settled, I've updated the RFC to version 1.1. The > premise of the RFC is unchanged, but the proposal has been expanded and > a discussion section added to summarise the ~100 message thread to > capture the major concerns raised in a condensed format. I hope I've > done a good job of fairly and accurately representing your concerns, but > if not please correct me. Hi, I will try to find some time over the next few days to write something up, because there are some clear misunderstandings in that current text. - It's not about union types. There are lots of examples using union types, because they're easier to illustrate than class/interface hierarchies, but "disallowing default to be passed to union types" wouldn't even help with the example directly below that sentence. - The paragraph about "Default as a contract" misses the point by a mile. There's a world of difference between "the new version of this library has different behaviour" and "the new version of this library gives a TypeError in my code which used to work". - It's not about "critics" and "preferred versions", or it doesn't need to be. We can say "here are some situations where it might be useful; and here are some situations where it would cause unexpected errors; do we think the benefits of one outweigh the cost/risk of the other?" I already shared this with you, but for the benefit of the wider audience, here are some examples I've put together of when users might vary the types of defaults, and how that would cause errors with the proposed feature: https://gist.github.com/IMSoP/16e2422d86e3ab513d6b0658009d0c06 I stress again, I'm not trying to win points in a popularity contest here, I'm trying to make sure we properly lay out the pros and cons of the proposal. It's worth noting that the drawback being pointed out is similar to one encountered with named arguments. Nikita dedicated a substantial part of that RFC to discussing the problem, its possible solutions, and the impact of the proposed direction: this section https://wiki.php.net/rfc/named_params#parameter_name_changes_during_inheritance and this one https://wiki.php.net/rfc/named_params#to_parameter_name_changes_during_inheritance and most of this one https://wiki.php.net/rfc/named_params#backwards_incompatible_changes Regards, -- Rowan Tommins [IMSoP]