Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115670 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 806 invoked from network); 9 Aug 2021 03:36:13 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Aug 2021 03:36:13 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 059B61804D4 for ; Sun, 8 Aug 2021 21:06:19 -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=-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-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 ; Sun, 8 Aug 2021 21:06:18 -0700 (PDT) Received: by mail-lf1-f43.google.com with SMTP id p38so3638701lfa.0 for ; Sun, 08 Aug 2021 21:06:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vJhkmlTMIVY8kcOgBlwdUnn0bkYLMv2mLh2KI0XGvl8=; b=hFVbWr17WdWToysUtzSRSVKDOWVxf2tO0+7zdFX3sfn/6u/VRGeIyL7Xwaqtx7+BXe 6kPwziGlb6okY5ZRD8anUjdGCAhCtUU0armw5t7UyU8nsDm8RpnKpIqVOAK9EHH3qGFZ d4OHwiU+966dayW4zt+b/bgH4eKIDD6k85x1JBxG3MhOap6KCmOWATkTS+lsATckCKii 9g7sIid/Nbg/lVw7+NwZIDhdkfkmWtwdfnAtpnCG0B7gvSG2qSu2W0j5rj7DdBC2QZgv FMphJ59QUJXS7D9FM+fbqKHdEZJkWQNpGxen+9UhWI0JbRCMv3nLJp8+I0s/9oSPSBe0 Uc4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vJhkmlTMIVY8kcOgBlwdUnn0bkYLMv2mLh2KI0XGvl8=; b=nU96mDGFH87zhCIpU5E98HeSrCN6RBnM16dsxB8cOdSFeOh7eYdtITfMy2PyaaIM7q fZT61W8YtO8b1jxg+hoyWlHnO//+5rJ7jjBhhoKEnRvhC74LihUUnQmQyTwQkHftBkd4 AF3CNkGGAdQSy8/EI8G5OzEQthQKh9sq/QTD6nQ/+9l4bQ3z6LFPYQAs21TFiHnZG+wG jt8dfddi+78WPx6wOHyzZWGRRFNvSkA5endmOKenHeaYIfJgyHUcxwy+lcqUt0/cDY+n FYgSFOBX5L6M5bfvlxwryfQEzP8ZcrsRgVdVWQIvZw43Cr8fAIS9RW6d0xrr0sdOD/yj f/QQ== X-Gm-Message-State: AOAM531R05DIxbLCRNGJpQdysjBtMTxdMwEVmEWmEug+D6nKn5Sp0Sjc tH3KDHYd0opHtUGJFMkgJuQQM2exi2C/TCGfUJc= X-Google-Smtp-Source: ABdhPJyA7RHYeGLoNwfO+hLW5jL98JW4pr54Ef1gHDZBX+gGyDK8geQC3Npz1v1NvNd+kVBjZJQVKkCHNHHxn1ZUkko= X-Received: by 2002:a05:6512:39c6:: with SMTP id k6mr15917553lfu.549.1628481974369; Sun, 08 Aug 2021 21:06:14 -0700 (PDT) MIME-Version: 1.0 References: <94696d46-c4e6-406a-b859-89144bff31bf@www.fastmail.com> <1ac66cec-239d-489c-ab96-304cc1e376fd@www.fastmail.com> In-Reply-To: Date: Sun, 8 Aug 2021 21:06:15 -0700 Message-ID: To: Rowan Tommins Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000009b02ca05c918815e" Subject: Re: [PHP-DEV] Revisiting Userland Operator Overloads From: jordan.ledoux@gmail.com (Jordan LeDoux) --0000000000009b02ca05c918815e Content-Type: text/plain; charset="UTF-8" On Sun, Aug 8, 2021 at 9:52 AM Rowan Tommins wrote: > > Yes, and as I demonstrated, there are situations where some of the > operators are only meaningful for a subset of operands. Saying that a > Money object is "Multipliable" would also be "a lie", since multiplying > two Money objects together is a logic error, even though multiplying > Money by a unit-less number is very useful. > > This is a good point, and your example of currency was a great example of a whole class of other things that would benefit: unit based values. I've started to work on the RFC document to collect some of the information we've discussed in this thread. I do not have the ability to edit wiki.php.net, so I cannot put the RFC on there at the moment. In lieu of that, I've created a placeholder markdown document on github for the RFC page: https://github.com/JordanRL/operator-overloading-rfc/ This is not where I will work on the implementation (which will obviously be on a fork of php-src). I've outlined my rough idea of the implementation I'm leaning towards in this doc, but have left out any discussion about interfaces for now, as I feel that's something that could use further discussion. Any feedback would be appreciated at this early stage. Jordan --0000000000009b02ca05c918815e--