Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108612 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 43275 invoked from network); 16 Feb 2020 03:02:30 -0000 Received: from unknown (HELO localhost.localdomain) (76.75.200.58) by pb1.pair.com with SMTP; 16 Feb 2020 03:02:30 -0000 To: internals@lists.php.net References: <003801d5e44c$169700e0$43c502a0$@gmx.de> Date: Sun, 16 Feb 2020 01:17:25 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <003801d5e44c$169700e0$43c502a0$@gmx.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Posted-By: 94.8.9.87 Subject: Re: [RFC] Userspace operator overloading From: marandall@php.net (Mark Randall) Message-ID: On 15/02/2020 22:05, jan.h.boehmer@gmx.de wrote: > Hi internals, > What do you think about the RFC? "If an operator is used with an object that does not overload this operator, an NOTICE is triggered, which gives the user a hint about the method that has to be overloaded. For backward compatibility objects, which do not overload the operator, are converted to integer 1 (current behavior)." Noooo :( Notices are the enemy of all that is great and good. If operator overloading is going to become a first-class feature then it should be treated as such, and attempting overloading operators on objects that don't have the relevant method available should trigger an Error. -- Mark Randall marandall@php.net