Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116809 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 39817 invoked from network); 5 Jan 2022 05:43:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Jan 2022 05:43:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 514741804C4 for ; Tue, 4 Jan 2022 22:50:54 -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, 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-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (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 ; Tue, 4 Jan 2022 22:50:53 -0800 (PST) Received: by mail-oi1-f178.google.com with SMTP id j185so62977715oif.8 for ; Tue, 04 Jan 2022 22:50:53 -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=7D8AFNdFCKtVFgIYD4nHgnvDmAu4cSpNrYXsgcMKhaA=; b=Q3Rod31YMfBsFrqTScgwl2xRQX0R+cIi+v4uqzPwdHLfROfFguFMPmIuD82NYu6q9C diInipAeNkdM0FML51vFbvHtdSTZJDyGXQdQsSQlLwHMLL/0cuRNg6wlmqtv7Np5sbon P5QBkdmQJwjC08h2/0i/CUqtv7KNi795qFhgjS4G0srNvqXQmLtviTJHbWxlhyFbK1FJ IjjiVoQ+1o0YsUNcrd6LQYtM3/BWGG4eoROrw3nIiYu/O76gX0yUvXsQfF0jyGSAffKo RCcNSQ9+M5JLzr1KGkyKzg+CSVwUho1W+UkjSM5xjXZdjtc/R2DS4Bqi0slmpCtR/6uz osJg== 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=7D8AFNdFCKtVFgIYD4nHgnvDmAu4cSpNrYXsgcMKhaA=; b=2R2SYKqRhkc/RZye1ZoqK7haEypMSWqs50vEpmLN0dcTCJ2gQZVVFP11EzxN9dRBjS LYbjU7EH8xB7dYwfwFBS6kcofz9CBtqN86END9JQEj34hNtea0gwARpRBKrhNsw0vgOh ooEjUxKezksIsHuS/VE9oSG+Q8PK5ymp0LOcF0QxSVzhMvjq92r5JN1nsBhKtPXKDNjc jbLeicfFd0SgipSQ3d3D5ELX+hABJ3brAEZxi2CXiRZNtnbM0PtNlgVyN1xh6tyQF4IS RLsyxrv9QYWA7Ni9WaPsbbxSAp7U08m3V8ARSstBlsEyWaAmAYK8lTyJ1D45jyIKfwMk ViYQ== X-Gm-Message-State: AOAM531Z4wj6uKpguHrQ+iEJGKhgtFvGgLohqb1ngCKS/j7ApFWGqGNq x2WrRZ6MBhSndCy4mwg1rs8UNq4ioheWf++7Vjgy6hMj X-Google-Smtp-Source: ABdhPJySX+iusfK71sKEjgI2Vh3PTOZv4KUqT1Sb/RQyM3gtUNYNnMFRr6O+tIm8LUMEJ8o6a/MvI/tGbuIPntZAQa4= X-Received: by 2002:a05:6808:1187:: with SMTP id j7mr1499610oil.173.1641365452890; Tue, 04 Jan 2022 22:50:52 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 5 Jan 2022 13:50:40 +0700 Message-ID: To: Nikita Popov Cc: Jordan LeDoux , PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [VOTE] User Defined Operator Overloads From: pierre.php@gmail.com (Pierre Joye) Hi Nikita, On Tue, Jan 4, 2022 at 12:38 AM 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'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). I hesitated too, however I think we can't escape this feature. Like it was for the annotation, we need to find a compromise. Your points are valid so I wonder if the RFC could be modified and get to the point we could reach that compromise. There will be the oppositions for the features as a whole, however I am optimistic about our abilities to get there this time rather than wait yet again a few years for something we know we will have anyway. Best. -- Pierre @pierrejoye | http://www.libgd.org