Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89969 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73757 invoked from network); 3 Jan 2016 02:43:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jan 2016 02:43:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=bishop.bettini@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=bishop.bettini@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.54 as permitted sender) X-PHP-List-Original-Sender: bishop.bettini@gmail.com X-Host-Fingerprint: 74.125.82.54 mail-wm0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:33331] helo=mail-wm0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AC/B2-33667-CEA88865 for ; Sat, 02 Jan 2016 21:43:56 -0500 Received: by mail-wm0-f54.google.com with SMTP id f206so139542875wmf.0 for ; Sat, 02 Jan 2016 18:43:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=EM0zCDsIcK8nA+yAsOHhEQIajBiOL5bq7ZHHudhP0qc=; b=MqwSa4Ar6NWMA8+A28w3+YbaNcQ851jHls1+aXrN9zo8TZ8FkKA9XrVo+TPXd9oYi1 EehByHGdaxsJGPXGiFKI6J7ANs3KE1gJJG2HOCRDSaPptRmajuoF1JtXuJDMyyraLMHj Q4K/607iqcpwLgvwpDfYvLU98R6rH/2HohANZOGpkaVtj7WuQOkFOtzzpo7zvEPgh66n 4tVOAT9iHrlSwTqajVp1vgaDzGmoZRmZ24fakOKFlzBh/E7vVp5W9yG5iz5C4+LM3evp WVZ2Ygto9J6aPdBTSE1Zn0BQ6V3j41GaRzJPzWWBgG60BpkmQXzUnp9wysCb55TmRK9k pWZw== X-Received: by 10.28.133.8 with SMTP id h8mr92266747wmd.71.1451789033652; Sat, 02 Jan 2016 18:43:53 -0800 (PST) MIME-Version: 1.0 Reply-To: bishop@php.net Sender: bishop.bettini@gmail.com Received: by 10.194.45.230 with HTTP; Sat, 2 Jan 2016 18:43:24 -0800 (PST) In-Reply-To: References: Date: Sat, 2 Jan 2016 21:43:24 -0500 X-Google-Sender-Auth: WLm0g1uhVHM0QnzZSnB6SyeQVfI Message-ID: To: Sara Golemon Cc: PHP internals , patriciotarantino@gmail.com Content-Type: multipart/alternative; boundary=001a11432edea3c8a7052864f9e6 Subject: Re: [PHP-DEV] RFC Operator Overloading in Userspace From: bishop@php.net (Bishop Bettini) --001a11432edea3c8a7052864f9e6 Content-Type: text/plain; charset=UTF-8 Hi Sara and Patricio, On Sat, Jan 2, 2016 at 9:14 PM, Sara Golemon wrote: > Patricio Tarantino has asked me to help him propose Operator > Overloading in PHP 7.1 (based in part on my operator extension in > PECL). I think we can expose this to usespace as magic methods with > very little overhead (the runtime check and dispatch is already there, > after all). +1 to moving this out of PECL and into the engine. > I do think that the "Future Expansion" section bears following through > with as well, but the basic set of methods already hooked for GMP > would be a nice start. > Whoa, that's a big list of magic methods. I wonder if a generic dispatch magic method would be more developer friendly. Something like: public function __overload(string $operator, object $rhs = null); // $rhs === null iff op is unary Thanks! bishop --001a11432edea3c8a7052864f9e6--