Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109352 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 90294 invoked from network); 26 Mar 2020 20:37:42 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Mar 2020 20:37:42 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9E4E01804F8 for ; Thu, 26 Mar 2020 12:02:38 -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-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (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:02:38 -0700 (PDT) Received: by mail-oi1-f177.google.com with SMTP id y71so6523887oia.7 for ; Thu, 26 Mar 2020 12:02:38 -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=6ojSU3TuoRxPqsP6PiO9L+aVXpDiabYucvenJ/AfmG4=; b=vFovSDCdHyKxV3q8zQ/0qp4NFkw5aqpEHISDE6OsHy044C2DUa1SEwGCUtFJMWccwj P2oqjFad5HUSswBwfGFpYwfZVI37ZaUc0kTVecdwzrbe9xlTGQ45GRjDwScXtZlp62Sg 8f4HGNAsDWQUWDeEJiBVtQcLqPA0K/8tYRE7tj0kHaWfjJHNeea7N6UAFqtz52PNDIRP wRmOMqQ0vbqjTVaVKgFmx2EpVkf+tbz2qOHMk1gzzXWGG15RXi1mHZnwc/4qF5DMoNOh WP6hohl1WWiMsvHwZ0xJrUBgNLDvtyBwMCNwfX5USrHKKgO5XeTC6b2GFt261HwZbXvy Hfrg== 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=6ojSU3TuoRxPqsP6PiO9L+aVXpDiabYucvenJ/AfmG4=; b=BcvWOXD3m7yjSQ33z7DWvtStWRR2DVVgb3qqxUpMmrj25OFNTcK+/NEuxD05NGXmwm RTvwJzG5h4HdRNpcWV5xeMOVz7s7/kKlMLetl8vygFT8gHI7WoBmJ4UOq4M+TGsiJKBm 4wqMNDV2jXzg9tiYxM2BgRWBKthIDnKSJTFXpxfbLlYim0bhTjfQKC0ytttmy98VWrhT xuWgxrzXtRBWPVku7+WZkRGlPuyUJYHnxr9kL6M9NmOXhsyImmITYR1Mowx0aNRGVcWN fP21nv8icd2QdrzedkKLSXaZE7l/GwpPp4WWKQXwMcf2VkWfg5T8BGUxY3peX3zjA/Zg Wcyg== X-Gm-Message-State: ANhLgQ2hhmzouC+ENd9jjHF9RwtD5uQdKlmbHNhRMMWC12qZNCT8zytm 55rAr9eQWs2jPdjuoPb0Z0qFnXH9Bgkxnot7pVg= X-Google-Smtp-Source: ADFU+vv/SgiJ4Q/RMucZYtQ/wmEv7fpVLZF9oMYJUZ9La9ApZhnHmaPx2Hes86zfQdeVmLGN1HkFmOVVx+jAuGUCHW4= X-Received: by 2002:aca:724f:: with SMTP id p76mr1368078oic.112.1585249357391; Thu, 26 Mar 2020 12:02:37 -0700 (PDT) MIME-Version: 1.0 References: <003701d6013c$9afe9750$d0fbc5f0$@gmx.de> In-Reply-To: <003701d6013c$9afe9750$d0fbc5f0$@gmx.de> Date: Thu, 26 Mar 2020 20:02:25 +0100 Message-ID: To: jan.h.boehmer@gmx.de Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000d3f2d205a1c6a09a" Subject: Re: [PHP-DEV] [VOTE] Userspace operator overloading From: michal.brzuchalski@gmail.com (=?UTF-8?Q?Micha=C5=82_Brzuchalski?=) --000000000000d3f2d205a1c6a09a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable pon., 23 mar 2020 o 18:58 napisa=C5=82(a): > 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. > I got two comments, a little late but always better than even later. The first thing is for operator methods when the operation is not supported I would see simply `return null;` as the right solution instead of constant, which name no one will remember. The second thing is notices which are confusing when suggesting to go and implement overloaded operator method on extension derived classes like stdClass like below: Notice: You have to implement the __add function in class stdClass to use this operator with an object in... The text of the notice is not documented in the RFC but it is implemented that way in the patch. A PHP developer is not likely gonna download the php-src source code, build environment and go with the ext/standard implementation and start adding it in C. The notice in this cases should either be different or not emitted at all. If the latter then that has to be documented I guess. Cheers, -- Micha=C5=82 Brzuchalski --000000000000d3f2d205a1c6a09a--