Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89999 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62109 invoked from network); 4 Jan 2016 19:39:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jan 2016 19:39:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.215.10 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.215.10 mail.experimentalworks.net Received: from [217.114.215.10] ([217.114.215.10:41660] helo=mail.experimentalworks.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F2/19-07292-F5ACA865 for ; Mon, 04 Jan 2016 14:39:11 -0500 Received: by mail.experimentalworks.net (Postfix, from userid 1003) id 274164161E; Mon, 4 Jan 2016 20:39:17 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on km31408.keymachine.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=4.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.0 X-Spam-HAM-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Received: from [192.168.2.34] (ppp-93-104-2-176.dynamic.mnet-online.de [93.104.2.176]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: johannes@schlueters.de) by mail.experimentalworks.net (Postfix) with ESMTPSA id AD90141617; Mon, 4 Jan 2016 20:39:14 +0100 (CET) Message-ID: <1451936344.323.14.camel@kuechenschabe> To: Sara Golemon Cc: PHP internals , patriciotarantino@gmail.com Date: Mon, 04 Jan 2016 20:39:04 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC Operator Overloading in Userspace From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Sat, 2016-01-02 at 18:14 -0800, Sara Golemon wrote: > https://wiki.php.net/rfc/operator-overloading Back in the days when I created the first implementation of operator overloading in the engine[1] I didn't see it fit for the language. Meanwhile we have more type hints and stuff making it a bit less magic. I still don't think this approach is really good. for instance we loose associativity; taking the Complex example: Of course this can easily be fixed by looking at the order, at least in this simple case. In a more complex example where a function might return an integer, double or complex number this becomes more complicated. For this to work we'd need non-member functions to do this and we need function overloading ... I believe we'll only get a half-baked solution and I prefer the current state over half-baked. johannes [1] http://news.php.net/php.internals/14558