Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116790 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 24235 invoked from network); 3 Jan 2022 17:20:37 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Jan 2022 17:20:37 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7805418054B for ; Mon, 3 Jan 2022 10:27:37 -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=-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 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-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (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 10:27:37 -0800 (PST) Received: by mail-ed1-f42.google.com with SMTP id y22so139119239edq.2 for ; Mon, 03 Jan 2022 10:27:37 -0800 (PST) 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=3/FEHSiCdyF2m3qIJRo7wW+Sthd9LLM3Tn+4qIhJ2c4=; b=VQ0XEcMsqcdyxl0BRblb4/9jSf0NFRR1DdAredkRFZ7K+j6oEgmw4ZFyUp0Vus4JER 8Gg/kdUWWHN11GM1c2g5D+1V8qLFrXUlEd/2y3AiRWgfbPUOjD1uREAtN+BpNnAj3cgB gKiRRVxmpLP6AU6MPI6BMDjkD/A9mAmcCA8T5UFawC3UdeZOwTmUikTAaXW6oQnOnpnv 10ue2gMEyzYAmx5j/0mVto/zvhDkkwlSsXVnhjpCCBQiv5kkMSlZVSnmRcAIHMCzKTKZ G+nr1+PD4QbRKJ6QxdteuubA1u0qoVS+BlT6cK+TIJnAZYKcg+4GTbDc4diL783WCsDZ SkWQ== 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=3/FEHSiCdyF2m3qIJRo7wW+Sthd9LLM3Tn+4qIhJ2c4=; b=MpVznGt/suob75KcVxCW4249gu5S547BH+vK/l1UwrPubfcPbaWWSnj1fgWc/cfgn3 73KfZ2Q1pBZ6WfdvpUfJXK/BPwshmtEQxy8n4H/l+gUBm/YegnxRht2HHJoxYBuSN616 M0kxJDbYWSOEmeeHqRCZUSNV88w1dH20Zr7lRvoXBjZS0V9CQEvwVZXGST7NLWnYK6uK ylY6VftWxRe0tj17E4o1xYDuYu5Zn2KODcm1fKf9PwjFThKz4bW4J/NFALPCZzIsSS7j gwkyoxEeSSbIx4ClmKaWBEf5dbnN5PT2TyWcmYtp5fsz/ZIyDlWkUNNeqzsGJq8yOh+r H3nA== X-Gm-Message-State: AOAM531GOa2rxfzSLWSy+eF4JT1avIZfRSpVudv8LRK9F0SjiKGFefGc 8EFMtwg4IuhZgPfPMCeezfWe3XbxU8l9MSpzaeY= X-Google-Smtp-Source: ABdhPJyTm2sEWJsAN4QCM7rXa/AauSj+PwHqmqa+jv+1+AP8RabO0CaTRI9Qsaw2Sj1CeSbevkQpU3tPxqwX9QxuRsQ= X-Received: by 2002:a17:907:2beb:: with SMTP id gv43mr33808927ejc.244.1641234455789; Mon, 03 Jan 2022 10:27:35 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 3 Jan 2022 18:27:19 +0000 Message-ID: To: Nikita Popov Cc: Jordan LeDoux , PHP internals Content-Type: multipart/alternative; boundary="000000000000bb05f605d4b1acea" Subject: Re: [PHP-DEV] [VOTE] User Defined Operator Overloads From: davidgebler@gmail.com (David Gebler) --000000000000bb05f605d4b1acea Content-Type: text/plain; charset="UTF-8" On Mon, Jan 3, 2022 at 5:38 PM Nikita Popov wrote: > On Mon, Jan 3, 2022 at 1:14 AM Jordan LeDoux > wrote: > > > Hello internals, > > > > I've opened voting on > > https://wiki.php.net/rfc/user_defined_operator_overloads. The voting > will > > close on 2022-01-17. > > > > To review past discussions on this RFC and the feature in general, please > > refer to: > > > > - https://externals.io/message/116611 | Current RFC discussion > > - https://externals.io/message/115764 | Initial RFC discussion > > - https://externals.io/message/115648 | Pre-RFC discussion and > > fact-finding > > > > Jordan > > > > Voted No on this one. I did support the previous proposal on this topic, > but I don't like the changes that this iteration has introduced relative to > the previous proposal. > > The part that I dislike most (and that I consider an exclusion criterion > regardless of any other merits of the proposal) is the introduction of a > new "operator +" style syntax. I found the motivation for this choice given > in the RFC rather weak -- it seems to be a very speculative > forward-compatibility argument, and I'm not sure it holds water even if we > accept the premise. There's nothing preventing us, from a technical > point-of-view, from allowing the use of some keyword only with magic > methods. On the other hand, the cost of this move is immediate: All tooling > will have to deal with a new, special kind of method declaration. > I agree wholeheartedly with this. I don't have a vote but if I did I'd vote no. I think if operator overloading is to be introduced, new magic methods using names like __add and __equals are preferable for a number of reasons. > > I'm also not a fan of the OperandPosition approach, though I could probably > live with it. The previous approach using static methods seemed more > natural to me, especially when it comes to operators that do not typically > commute (e.g. subtraction). > > Regards, > Nikita > --000000000000bb05f605d4b1acea--