Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125582 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 9D2731A00BD for ; Tue, 17 Sep 2024 11:21:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1726572223; bh=jk/S6eL/p+LzvczYcSnxeyAnQc6LeVNv+yvbzQsF4rY=; h=Date:Subject:To:References:From:In-Reply-To:From; b=Lp0RupzpehzpZO+2A76X0AFEvj47oum2DYDEyJJs3fGxsXezRxf8RHy2PQMmchnss G1RHTsXVgyQQbQKqOptANa2ynRagHmVxTpL+fQgLIb4RlRkqj4rtNJ+sa4GjkORIin yM3dC0tFy1hS24zdpisUz/O90/djxcdeBhRWjExpDuzg3pV2IObQCTe/tScOcbUc1X NO5W0fsxReaBGh6A/3IQ1+63Aw+yK68XVTQ4lQStKl7U8xLmujHTP5YdI4W2XmdU2s /kjcp4TNFeDIAlU1pS6BX4MH7YmRWhN43bDQfGohXryyJq9wXBv2LXBbVvbV2aej0f mRpe/QpqqYTkQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B700C180069 for ; Tue, 17 Sep 2024 11:23:42 +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_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_KAM_HTML_FONT_INVALID autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 17 Sep 2024 11:23:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1726572095; x=1727176895; i=a.leathley@gmx.net; bh=fTpkRgXiLJJhwLJIOi0CUT1+Oeg73DRO6ga/98Sh3zY=; h=X-UI-Sender-Class:Content-Type:Message-ID:Date:MIME-Version: Subject:To:References:From:In-Reply-To:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=p1VQVUnocyvInqgnkop98wHUWRDg3T2/jrdD3xe/B64yaIO9GR11HncEu/f7kk6I PNUSbxaxSzlEiTSS2mxt50CkUdzoSqoXei+Mcwc+L3xOXCCBI38Rd+9XxUWhrZNc5 AdkOn+9Dy4Zj1/DxVWNdr6mUbUgMB7GhAGOMXdnY0Ent01PG6PgY57aCUlFLRq6qh og1aC7LKGdKhjaf1KjnN/pRhPF7Z08BrSjP2ngZCuy965tTKIdkT/1Tb4jzxjarMC CeZoQoI9eIula5FD4+EJFqrgFDpKFfyORZPmR2LHnkEyq28+AKnjOrsr/ExCrg3zD TD5h2sAeQmZe8xJG2w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.178.120] ([24.134.51.41]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MxUs7-1s1kCE1oPB-0117yK for ; Tue, 17 Sep 2024 13:21:35 +0200 Content-Type: multipart/alternative; boundary="------------S0bkrYaaZWR9b69hv0Vjs72d" Message-ID: Date: Tue, 17 Sep 2024 13:21:35 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [Pre-RFC Discussion] User Defined Operator Overloads (again) Content-Language: en-US To: internals@lists.php.net References: In-Reply-To: X-Provags-ID: V03:K1:norlrSi0vvnsIMsRhwYQ7PaSkRcVSflZUbBw6MEtivev0rMmQpD 3InBToSy+pS+GTrsTIEKw06RkVB7mfJFjMxJUp/I1ABr69kjEhYDO0dJoAqdFc050U2TXpJ VNK7vdJ8qHUaKX1+3E5ixSvfucMZySqePmsjaeU/+w9YBu9334haAle1yigQ/RYoNG4to9Z 0jpD7sYkh/h6k5yBZOo1w== UI-OutboundReport: notjunk:1;M01:P0:2ZuHUxXrr6g=;mE+2Vy2B9ZbulvhGHO5aX9NuXtX MBKk84bRj/BO4a32Of9KdJVqkpPr3aQBlFsu1tdaLzKvTF6XoNj7OAxR3QodXx3O9z3hilckw p1SCQgoSybsfU67rNiXZ/KlFn3O5jxxpOfylheN/u3iWZQGZtuh82z4LHFfPU3CnIf9O7qesZ 6U3iZLZ8dHbcwHjmdJeAdVajeptQgzIQUjRgADvD7buTnvNpIlsvT7y2CkuawaO1DYNmuCkvC mFFvHPlQzl5ub+KnlB4GLYNTNjFby2LjfAH5ZkSBhsb3xMvmj3Z5BJF4efcRKkKSInpYsBVYI GrsWmEV6rpfQSZPsezkrmItycrgCB90vSyH1U0O9kCKXYhayicAStU0zFSdtPqhzi4woUvtFv 5OQ8KuF4Z6n3ZzbjIaKit1YpJVee8w4nyJ1OvqT8TEEIq5Qac2R43wPAn5m/rntTfeEuefSYE n1JmdJwp2rqaxFnH4A3kJIqKbDD+9HM9xWqIpyhW5SZvF85sIgJrwjmyk+aFE/mfRdC7p8CQw lRrH3fSchstP1jCxmAhOGknZFm21NG6FXaz6H2RZCUjf6yubwU4WqnLQS9ETCFK5Hhl6TfCp8 /41vuPKhr1VVZqWwI1D3dnf9wSO2E2l0tgKQblzpbDcAaxL70UoGpkdj2MngeIVkA18mbmtpy hS+UQhDbw8308CesKZYt1i413BDTsFFzGlyB/KUvr1siSsbbK4oN8Sx5iH0jPx7B3LqP6QQeY jeYSPyrjnNi1gZgMh6LHT8mt/su3QB9cRmOTTRmRsU5z4w+3GZNt1+eyZh6ZSoCQNf0Y2pmiL JP3PkJBU+4hKiFFkVY9XcFsQ== From: a.leathley@gmx.net (Andreas Leathley) This is a multi-part message in MIME format. --------------S0bkrYaaZWR9b69hv0Vjs72d Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable On 14.09.24 23:48, Jordan LeDoux wrote: > > 1. Should the next version of this RFC use the `operator` keyword, or > should that approach be abandoned for something more familiar? Why do > you feel that way? > > 2. Should the capability to overload comparison operators be provided > in the same RFC, or would it be better to separate that into its own > RFC? Why do you feel that way? > > 3. Do you feel there were any glaring design weaknesses in the > previous RFC that should be addressed before it is re-proposed? > > 4. Do you feel that there is ANY design, version, or implementation of > operator overloads possible that you would support and be in favor of, > regardless of whether it matches the approach taken previously? If so, > can you describe any of the core ideas you feel are most important? > Hello Jordan, Happy you are following up on operator overloads, as I was sad to see the vote fail last time. I think the RFC might benefit from focusing on the comparison operators and the basic arithmetic operators this time, so =3D=3D, <=3D>, +, -, *, / (and maybe % and **). I would especially leave out the bitwise operators (for a possible future RFC), as those to me seem extra niche and not very self-explanatory in terms of good use cases/examples. =3D=3D, <=3D>, = +, -, * and / would deliver almost all the benefits to operator overloading I can currently think of. Giving more concrete examples in the RFC of places in the current PHP ecosystem where these operators would simplify code might be helpful - the last RFC had mainly a generic list of use cases, but seeing actual code would help to make it salient how some code can be a lot more readable, especially if you now know about even more use cases than 3 years ago. Otherwise I am hoping that more opponents of operator overloads will chime in and give some constructive feedback. --------------S0bkrYaaZWR9b69hv0Vjs72d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
On 14.09.24 23:48, Jordan LeDoux wrote:

1. Should the next version of this RFC use the `operator` keyword, or should that approach be abandoned for something more familiar? Why do you feel that way?

2. Should the capability to overload comparison operators be provided in the same RFC, or would it be better to separate that into its own RFC? Why do you feel that way?

3. Do you feel there were any glaring design weaknesses in the previous RFC that should be addressed before it is re-proposed?

4. Do you feel that there is ANY design, version, or implementation of operator overloads possible that you would support and be in favor of, regardless of whether it matches the approach taken previously? If so, can you describe any of the core ideas you feel are most important?

Hello Jordan,

Happy you are following up on operator overloads, as I was sad to see the vote fail last time.

I think the RFC might benefit from focusing on the comparison operators and the basic arithmetic operators this time, so ==, <=>, +, -, *, / (and maybe % and **). I would especially leave out the bitwise operators (for a possible future RFC), as those to me seem extra niche and not very self-explanatory in terms of good use cases/examples. ==, <=>, +, -, * and / would deliver almost all the benefits to operator overloading I can currently think of.

Giving more concrete examples in the RFC of places in the current PHP ecosystem where these operators would simplify code might be helpful - the last RFC had mainly a generic list of use cases, but seeing actual code would help to make it salient how some code can be a lot more readable, especially if you now know about even more use cases than 3 years ago.

Otherwise I am hoping that more opponents of operator overloads will chime in and give some constructive feedback.

--------------S0bkrYaaZWR9b69hv0Vjs72d--