Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116781 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 9135 invoked from network); 3 Jan 2022 15:55:29 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Jan 2022 15:55:29 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3590F1804A7 for ; Mon, 3 Jan 2022 09:02:29 -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=-1.5 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,SPF_NONE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS16276 94.23.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from processus.org (ns366368.ip-94-23-14.eu [94.23.14.201]) (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, 3 Jan 2022 09:02:28 -0800 (PST) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by processus.org (Postfix) with ESMTPA id 3369151005CC; Mon, 3 Jan 2022 17:02:27 +0000 (UTC) Message-ID: <80d12d2b-8c4c-73a9-0d09-5db209c3fc03@processus.org> Date: Mon, 3 Jan 2022 18:02:26 +0100 MIME-Version: 1.0 Content-Language: en-US To: Larry Garfield , php internals References: <3225c921-9b26-d2e0-f76f-45fff6f5a12a@processus.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Authentication-Results: processus.org; auth=pass smtp.auth=pierre-php@processus.org smtp.mailfrom=pierre-php@processus.org X-Spamd-Bar: / Subject: Re: [PHP-DEV] [VOTE] User Defined Operator Overloads From: pierre-php@processus.org (Pierre) Le 03/01/2022 à 17:12, Larry Garfield a écrit : > On Mon, Jan 3, 2022, at 9:52 AM, Pierre wrote: > >> I personally tend to agree with everything that Marco said. Especially >> regarding the fact that it's adding huge complexity to the language >> itself for mostly edge cases. >> >> I'd argue there's many much more valuable features that could be added >> to PHP before operator overload, such as generics, rationalized >> collection API and scalar objects with methods for example (which all >> could be magnificent tools for improving the operator overload RFC). > Those are all independent of operator overloading. There's zero reason one needs to come before/after any other. Everyone wants generics, but they're really hard or Nikita would have implemented them already. This is a non-argument. > > Also, people keep talking about edge cases. In my experience, "are these two objects equal" (for some object-specific definition of equal) is very much *not* an edge case. I may have less use for overloading % as I don't use advanced math that much, but I compare things all the frickin' time and that would be incredibly useful day to day. I think you read it too quickly. Anyway it was just examples, my point is not specifically about generics, but about the fact that operator overloading has been hugely controversial, and independently of the fact that I think this is a very well documented RFC, I still don't like it and express my opinion, I probably would not use those, but I eventually will be step debugging into some, and god, I don't wish I'll have to, really, I hate magic and non verbose code. Nevertheless, I have to admit, if I had the right to vote, I would abstain because it still a feature a lot of people want. Best regards, -- Pierre