Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117694 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 6782 invoked from network); 7 May 2022 20:30:05 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 May 2022 20:30:05 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4F86F180339 for ; Sat, 7 May 2022 15:08:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (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 ; Sat, 7 May 2022 15:08:09 -0700 (PDT) Received: by mail-qv1-f47.google.com with SMTP id c8so7906560qvh.10 for ; Sat, 07 May 2022 15:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20210112.gappssmtp.com; s=20210112; h=from:mime-version:subject:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=iCNy/ZL9FCwRdFp/zUwpC2VFf6IHtTiUP3xUyEAHBXU=; b=Vot3/vxYIfr+IkQi4GffWXcqRU9aOxDCaLemzqkRGswFlRstorvRr+35LzLS82kWw8 TBCLGsicXXns/Z0TcXNRV5SNpYXaF4kow3NHdkBNOCLvV8JfR4l9JnNk/4LXs88oFvH2 D8986Fj2M873M9y877x1Svc5A4D4BN55nTCsjs6HQlCQdXSaB4uEUuAXgpN38eP0YbBV clAvp2XsEhtwsAcHNW3y1x1gLw6zYt13TR0bOsvLA+T+O3MHUnGei+8QQX6darc5XNs/ F4W/cZJDpGMN307ybciYBO7sOlH0RIr0cgW3aji0sgVA6jJxu9DYaeIQV30+016SxLYt fGgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:mime-version:subject:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=iCNy/ZL9FCwRdFp/zUwpC2VFf6IHtTiUP3xUyEAHBXU=; b=QOBU/ay+9+K6vDaW5xBiqp7bVpFUysPfhAQrYTaOKlvi6u1sQVhpVItV12D6U5yDxS bdPlA5k5Gvst5hoHoxiIjSvs5um7cAoHAWBAKTYegWNtkfyUj5Qw9Hb2aTzrW7/CPDNR A4rZImkiA3DcgeE/AkFhA46cuQYrotJ6oxFsl9E5MhSwSdZBmEjl6+qbr7XigCXfSCpK EBTBIJGQbtBNh8jD1P7KkRtYBB6+KJgSD/U8M7Y7B/rzSWmbqd1Zgam/sEesgTe28Pua 3U+pK09fA2H/9zFct+92jPQkc5DEdu/lFtvAx8YxM9N/XGHdaVGAhmZiAN1DOPUmGjXY sUxQ== X-Gm-Message-State: AOAM533/bk8daTxIUyRYOpmIn5RAq61HtI4/oy2vEsdx1+U45x+e34Ry wn2Ua4PJuW2jNvhMnGJl1rkI7d2MVBb8Yw== X-Google-Smtp-Source: ABdhPJwrsehbxF6fDuYMLEly3p8+1DshOZl3LyiRf5gnfnSnItC3X4xOK1XIcjUaO0Y+/I4bJqwlxA== X-Received: by 2002:a05:6214:5094:b0:45a:b985:5a78 with SMTP id kk20-20020a056214509400b0045ab9855a78mr7881510qvb.54.1651961289066; Sat, 07 May 2022 15:08:09 -0700 (PDT) Received: from [192.168.1.10] (c-24-98-254-8.hsd1.ga.comcast.net. [24.98.254.8]) by smtp.gmail.com with ESMTPSA id f20-20020a379c14000000b0069fc13ce224sm4566950qke.85.2022.05.07.15.08.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 May 2022 15:08:08 -0700 (PDT) X-Google-Original-From: MKS Archive Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) In-Reply-To: Date: Sat, 7 May 2022 18:08:07 -0400 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <228027D9-954D-4CEE-9152-8A776E83B833@gmail.com> References: To: Jordan LeDoux X-Mailer: Apple Mail (2.3608.120.23.2.7) Subject: Re: [PHP-DEV] The future of objects and operators From: mike@newclarity.net (MKS Archive) > On May 6, 2022, at 6:16 PM, Jordan LeDoux = wrote: >=20 > Hello all, >=20 > I took a while away after my operator overload RFC was declined. I've = been > mulling for the last few months how to move forward while respecting = the > concerns and feedback of those who abstained and those who voted = against. > But I feel like a separate discussion needs to happen first after > considering many different approaches. >=20 > # There is Considerable Demand For Improved Control of Operators with > Objects >=20 > This doesn't apply to all operators. I have not seen any comments in = the > last few months of digging of people who are desperate for the pow = operator > ( ** ) for instance. However, many people who work with math in PHP = have > use for at least the arithmetic operators and I see this comment = frequently. >=20 > Totally separate from the math domain, I've seen many comments about = the > desire to control the comparison operators: >, >=3D, =3D=3D, <=3D, <, = !=3D, <>. This > is something that would have numerous applications outside of = mathematics, > and there's even been an RFC worked on (that was declined in 2018) by = Rudi > to implement just comparisons. >=20 > # Different Voters Have Different Concerns >=20 > This is an issue that almost all RFC authors must deal with of course, = but > this particular subject suffers from it more severely than most. For > instance, in some of the past proposals that were more limited than = mine, > there were comments that a full operator overloading solution should = be > provided instead of something halfway. >=20 > However one of the comments I received more than once was that I = should > separate out the comparison operators into its own RFC, since those = have > applications outside the math domain. >=20 > # Is Math A Valid Use Case? >=20 > One of the more shocking (to me personally) pieces of feedback that I > received from more than one person is that math is not a valid use = case in > PHP. I am... unsure about what to think of this opinion. I guess I = would > like to discuss and find out if this is widely believed among voters. I will repeat what I suggested back before the RFC was voted on, and = that is you consider *starting* your campaign for operator overloads = with an RFC to add a built-in Math class (or set of classes) to PHP, = one(s) that can have all the operator overloading it/they need(s). Minimally the design process in the open would be insightful for = everyone interested in the topic even if the RFC did not get accepted = =E2=80=94 although the intent should be that it would =E2=80=94 because = it would change the operator overload discussion from a very abstract = one to a very concrete one.=20 It could also illustrate the benefit for operator overloading, and = illustrate the design process of deciding on how operators are = overloaded and what the benefits and tradeoffs are of different choices. If the RFC did not pass, at least it could result in an understanding of = which operators minimally need to be overloaded for the Math use-case = and serve as a blueprint for adding Math objects in userland if and when = sufficient general-purpose operator overloading could get added to PHP. Further, if an RFC to add a built-in Math object to PHP passed it would = effectively eliminate the red-herring of "I don't do heavy math work." = Such an RFC would also, of course, not have the other two (2) categories = of objections that you named in your other email. Again, #jmtcw -Mike