Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109355 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 13841 invoked from network); 26 Mar 2020 21:31:04 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Mar 2020 21:31:04 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 745881804DD for ; Thu, 26 Mar 2020 12:56:00 -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-vs1-f68.google.com (mail-vs1-f68.google.com [209.85.217.68]) (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 ; Thu, 26 Mar 2020 12:55:59 -0700 (PDT) Received: by mail-vs1-f68.google.com with SMTP id s10so4723935vsi.9 for ; Thu, 26 Mar 2020 12:55:59 -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=88GrmmzK69+cFogO21NahsMWg9SXV2YikaCeatrojpw=; b=JEfABwryDfdUkPthbf+2wzsSwrMA6K2lMxUTkZrn/1j3gbQpIw9Zo07qyyp7R5EnlS YiY5dMAd1cQ4Tiudvul3asT161vFevfaSz9kAETy3+Ge2+KU0opg4o/HiUd5emxhTZs2 Gm+XJjBXe+j9IS2+RQH4lt/NyFtRe13Z8S/iy6jV+9Ome46dcwipXsS0bTIZjkBYHVir EMPKa2lblmAkDS97F03tACPZGYEboisQi8XLVHu1Uxajedjrq/JYoarOZoo3R8pVVNhV z//zSZBcA8BNO+LH2wqFi9MVmlhVcOrFxGZTsUf5X0/W9IIlgDsVEFpLw0YwEewfqNSy JGpA== 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=88GrmmzK69+cFogO21NahsMWg9SXV2YikaCeatrojpw=; b=biNZzx/JcpVUPqIv0v26KJBovhmEpXdwl7HorYB61Z/f0HjHDB5CJ4JvYqhzajYtlP VzVjaoMUGzqM7TuBzHPym2j1HnCj2/FVb73kS4nuxFbU5nNJMAsxOhpfTh/tGrNY/aBs RXah+nZ8Qgkh1EEat/B1+RDeQqaKP+iS8JJAuNqFoiNEZuQi7WFSucfeakTJ0DaLYusr AzHtf/T97tf6xWSIkOJHlwD/VJ7llOCB48bvSGS+FX9xZ8aafSIO9vuxTJZlso9B2oNo duap+3A5mQ0Fy4YEqzHTJrGsA73AeOwDAxe/HhxkL8XNoGmSx10mLD/ih/whJKumnZY/ lf7Q== X-Gm-Message-State: ANhLgQ3RpwrufMdnsa7hNbi9gjVhatOIiNbu/6MEG6gb0kRlC1wVkuW5 HIBW8gwpfq3I1BfLXWzKF/tZZi8p+7eG0zz+34Q= X-Google-Smtp-Source: ADFU+vvox7Lq/hcK84/tmDDBhRNBJB2l4hxXIa3IRMxwXz5iyZmFO6QOV+IoV5xmfMi5we1IWxqdjpMperCHb5UlP+g= X-Received: by 2002:a67:ed93:: with SMTP id d19mr8593896vsp.60.1585252559095; Thu, 26 Mar 2020 12:55:59 -0700 (PDT) MIME-Version: 1.0 References: <003701d6013c$9afe9750$d0fbc5f0$@gmx.de> In-Reply-To: Date: Thu, 26 Mar 2020 15:55:47 -0400 Message-ID: To: Marco Pivetta Cc: jan.h.boehmer@gmx.de, PHP internals Content-Type: multipart/alternative; boundary="000000000000aa0abf05a1c75fbf" Subject: Re: [PHP-DEV] [VOTE] Userspace operator overloading From: matthewmatthew@gmail.com (Matthew Brown) --000000000000aa0abf05a1c75fbf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I accept that it adds an extra level of understanding to the language =E2= =80=93 if you see function addAmounts($a, $b) { return $a + $b; } you no longer definitely know the answer will be numeric. However, I imagine that the sorts of people who will use this are _also_ the sorts of people who would add type annotations clearly =E2=80=93 so you= 'd much more likely see function addAmounts(CurrencyAmount $a, CurrencyAmount $b) { return $a + $b; } where it's trivial to understand that there's userspace operator overloading going on. On Tue, 24 Mar 2020 at 06:04, Marco Pivetta wrote: > Hey Jan, > > Just posting here why I voted "no": it is not your implementation proposa= l, > but rather the concept per-se that IMO shouldn't land in the language. > > Operator overloading makes call-site code reading extremely hard, and it > makes the language much more complex for very little benefit. > > Everything suggested in the RFC can be done by using explicit arrows: `->= ` > (method calls), which lead to expressively named methods and parameters. > > I have posted similar thoughts about `->__toString()` and `->toString()` > when it comes to cast operations vs explicit calls at > > https://github.com/ShittySoft/symfony-live-berlin-2018-doctrine-tutorial/= pull/3#issuecomment-460441229 > > Overall, without type classes and infix functions, operator overloading i= s, > IMO, just messy. > > Greets, > > Marco Pivetta > > http://twitter.com/Ocramius > > http://ocramius.github.com/ > > > On Mon, Mar 23, 2020 at 6:58 PM wrote: > > > Hi internals, > > > > I have opened voting on > > https://wiki.php.net/rfc/userspace_operator_overloading, which allows > > users > > to overload operators in their own classes. > > > > Voting closes on 2020-04-06. > > > > Regards, > > Jan B=C3=B6hmer > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > --000000000000aa0abf05a1c75fbf--