Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116818 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 77738 invoked from network); 5 Jan 2022 18:03:54 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Jan 2022 18:03:54 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 78A2E1804B1 for ; Wed, 5 Jan 2022 11:11:24 -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=-0.2 required=5.0 tests=BAYES_40,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-f47.google.com (mail-lf1-f47.google.com [209.85.167.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 ; Wed, 5 Jan 2022 11:11:23 -0800 (PST) Received: by mail-lf1-f47.google.com with SMTP id x7so18935lfu.8 for ; Wed, 05 Jan 2022 11:11:23 -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=9OG8MhZjypRd6uHm+1RMY0RcFejdceGNWTT+VZcDGFM=; b=cYicoKxvQ+1Uv+IbkLdXzJAyClmzC5EfYz7juBoVStaKnkQ9vQ0locqysbN4KfzLtC P5JuiTQ+rqPoNEWpTzyQeWqFu0+uLj4ubWIJqs+Mw/NLMP4T6I9hUhe4tBjy0/hbosV1 qY0my10rtY3b35mud3fk6VuCqWvUbFEUJlN7bVuqp2xGOzVOzlRlpWLhJtsAozDOfSej o97xGuib96Te2OdT4JDzLoFrjFBhwGTI6ycpOfvXGhyKIC5s4t03DZVQzb7Y8fpyeOQ0 FislgDh/BH1Le4yHXfZ7q0ahIdMY+z+BU4V4bziVL83kH5wgUZqYMaKWuMehFTqjCTGp nseg== 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=9OG8MhZjypRd6uHm+1RMY0RcFejdceGNWTT+VZcDGFM=; b=HXaoGFWJjcn7uZDBI3Z2JE+a0mtaN5LMGGijM6TR0kOeMaNiG4fFvc/yAryy5CrigW tzDdtxX/DPq+cU/bqkxRaUTvaDPw4E/ZKtyF9oa23qqPar1x69S9/cPT5uPviLjyVxgT 2dDFIVZ7/UGe0ile7Ku47vhjcun8j1bMOi+Z6RBtQR6RuoBWMaVzbcYVvV2VQe47DbFe KIJ7BCpw2V57vsbziwxqd6B6J41845driakGmx1jQ4B3zOzqWiGfylADrXo92s1ghu69 c3bmzfSq3QujVaqO51/g5AMTRb7KVU2Y2P9cZGdtAvgFAwr0vqOxBT8T0QKlgCN8CAHh F9Xw== X-Gm-Message-State: AOAM533KySrPLY3LHu9UBOli8LRRwbBoTr6VpWBZ8yWccoG5iHmi+gN/ C/LGTN/3yQ1UldW3tjLK4T5ikGJk3DaCTmaHuCE= X-Google-Smtp-Source: ABdhPJwezHDhvi5lsidIWpJrOQHQv7FIfKG4nDCCN8jxa/Ae7p6OPd55/1TSLgGepxQr71R1WRIQP2/LdFllnySJRdA= X-Received: by 2002:a05:6512:1188:: with SMTP id g8mr42299033lfr.209.1641409882066; Wed, 05 Jan 2022 11:11:22 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 5 Jan 2022 11:11:07 -0800 Message-ID: To: Andreas Hennings Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000f3920e05d4da84cb" Subject: Re: [PHP-DEV] [VOTE] User Defined Operator Overloads From: jordan.ledoux@gmail.com (Jordan LeDoux) --000000000000f3920e05d4da84cb Content-Type: text/plain; charset="UTF-8" On Wed, Jan 5, 2022 at 6:33 AM Andreas Hennings wrote: > Hello Jordan, > do you have any thoughts about these symmetric/left/right modifiers, > to get rid of the $operandPos parameter? > > To me, the parameter could be the kind of thing where in hindsight we > ask "why?". > > Also, can we drop the "public" modifier, if we do a new version of the RFC? > > Cheers > Andreas > It's a totally different design concept (symmetric/left/right) and I've been going over the design implications before I responded. For instance, wouldn't this be a special case of method overloading? You're overloading according to a modifier, not the typing, but there is that to contend with. If someone defined `symmetric operator +` and `left operator +` which would be used? (My feeling is left as its more specific.) How would they be stored within the zend_class_entry? Since they would technically have the same name, something would need to happen for them to not be in the function table. The public modifier is not required (as stated in the RFC), you can just add it if you want. Are you asking for `public operator` to produce a compile error? Jordan --000000000000f3920e05d4da84cb--