Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108620 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 46350 invoked from network); 16 Feb 2020 14:34:50 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Feb 2020 14:34:50 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6891C1804E6 for ; Sun, 16 Feb 2020 04:49:59 -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.7 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8560 212.227.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 16 Feb 2020 04:49:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1581857394; bh=9p5EL1hypoNl3ZgMa7xE7YSnslSXbiAh9UreTZQAz3I=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=MJAzQzuUAJR3k4azhDImbH15BljrpxIYAWSdvi8EENplxF7IwW6SboRMER9FFkvgJ nJSDk8/GrUVaXatNOkVoImtH3IsEExHj/dJd8HoMetPcK8oQ6rrXiSmJ1oQIJejsH0 bcjhd5jhASmYUeYGFLKp1Y2yusV3gHQOhFJ8Pmu4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from DESKTOPF2PTDOD ([141.35.40.65]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MHXBj-1jGBWd25bt-00DbCZ; Sun, 16 Feb 2020 13:49:54 +0100 To: Cc: "'PHP internals'" Date: Sun, 16 Feb 2020 13:49:52 +0100 Message-ID: <004701d5e4c7$951e3f70$bf5abe50$@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdXkxNKRrILMsBWuRdGlIat+Ir4wSA== Content-Language: de X-Provags-ID: V03:K1:r6KGKrjF3jllHUbXRdH214tmXExsUPo9aHKj7zy223uIzkVlB+C sWdOdqofYFsz1jFW2mQnwujE1fcjxBOVcGXmEKFckHQSghFq5YlHtaPVYVozSxenSlYGCWp BzedL8dLTtgghEsvfjKdointcKxDul33ybXXQEWQcWNhT43+tY91uMTGHR/FH7ahSlPd/Ms hWtUPwKCGnPAz/6PwpMCw== X-UI-Out-Filterresults: notjunk:1;V03:K0:dCsRNQd3Ato=:l34untZiV7bf2chLlr50jW kz0yYO9VB0Vn5dVoQWtPCeyVHSbJvcqthyQ0rCffaF3m/IOMq50UHyEETPrCCJo5qxBeWSOtP c9ehXZDf6BIItj12qadqAEuPvnGQDitjA/7/Wc8yvl0HYZzjAuEyvzexFLWcouHD+a0Z5DcHK kObO9B00wYsJQ6eUyMOzlPeOAw8UibdwXUcEW/oRUVEAXqvy4z1o1v1uhaXFy7gm/FO+rsf8N 2xsKIs/thvyJsMmJhupGQmT98G1PZgo55oMgFiNaAXVowR9cNvmpul925/26W/Moe1ieoZnI8 WgpQRS8msJqiD/OJiGmWFVAS07eM3uG0T2X2dk7D/yTe0iG+3kNuwC/M3WaTHlAA76oJihYB+ dXUjvy0Q66PtmK1nQhva2UFDRxF7QezEabT++jGIbeGo7jDJ27aJqeGXrt119JVs2PjE3zVu/ WJhtdVoLS4IJrItuarAQ9ZR3zIqE7ENmYxS57PgBUkYUwK3dOAQeFC8L4xV8u/gEbu7Mkw1Ta s3kziIGvMUOJqiUHDgcUb/SXbGArqHIA41AhlQvAJspwpU/94pHDkb6+wimQV/zsvN4oLOr3/ ziZuF3Yb8xg4/d7t6k2Rn1eotwt96t5FdNBUyysHs/L8M9M2YSh7NtqNOb5yp+7G9u059k0Jg HNSHBXwLtQNKyR3hmqecf8X0/N+9cACxKeX/945tr4lAZM0xSmaWdxo/tk009NTjuim7PY2Us Loq8GHh3yQ2e7wpnwW5CyE6a3OWw9QC6gw6kzinakn1UY4jqyS+APmPNnO9IUApBl/sw+h+IH /P07fJYvqhwFhI+wqiT1P+Q8Gtg/h0dJmIxDTKoV8YkEau8oCeNQ0Q/ZVQpluDnP51cVja67t mUgLNZhSWwE5PtjFSXryGqdyYm6oDddalLyM82A2asHjgojhNbyaZ0WSQjD7AA9cu0rP/edbJ uKfZN9kyrBtWqXpALEj+sEbl36r1Yp+PLaDkVQEDHgOwFFDACdRshaAYGfsZeZyexJ6g+ERHK VgX2M+jNaG5uEgve3/wxSE7N8Lb6M+q3bLYtJTHRej/cfvGrUSn7MPnPQ/ko1DlysSE+U9Sfs YFLRf+31pbUZPJvp2XvhAphuiMUU9roXbsgDhSqjoPSXXONoZyEhDb3neo8q9u4cX55x2G1HM 40gsuo7P7BDqD5DxxVVTwY1NMt29+jC+G8IeeR+qx+vY4x4eSUWeCQZ9BfKdjF9xxVHqfgLXp HTzzt7FKup28pCxzQ Subject: Re: [RFC] Userspace operator overloading From: jan.h.boehmer@gmx.de On 16/02/2020 01:17, marandall@php.net wrote: > Noooo :( Notices are the enemy of all that is great and good. >=20 > If operator overloading is going to become a first-class feature then = it=20 > should be treated as such, and attempting overloading operators on=20 > objects that don't have the relevant method available should trigger = an=20 > Error. I agree with that throwing an error would be the better approach. But = that would be a breaking change, as it would break existing code. Something = like this is valid code in the moment: $a =3D new ClassA(); $b =3D $a + 1; Currently a only a notice (Object of class ClassA could not be converted = to int) is triggered, and the object is handled like a numeric 1. ($b have = the value 2). I have no clue, how big the impact of changing this to an error would = be, so my current implementation just triggers an NOTICE. In this RFC https://wiki.php.net/rfc/engine_warnings, it was decided to remain the NOTICE behavior for casting an object to an int. If it is decided to reclassify the usage of operators on objects = (without overloaded behavior) to thrown an Error, this would be totally fine for = me, but we should discuss this. Greetings, Jan B=F6hmer