Re: RFC Operator Overloading in Userspace
| From: | Bishop Bettini | Date: | Sun, 03 Jan 2016 02:43:24 +0000 |
| Subject: | Re: RFC Operator Overloading in Userspace | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-89969@lists.php.net to get a copy of this message | ||
Hi Sara and Patricio,
On Sat, Jan 2, 2016 at 9:14 PM, Sara Golemon <pollita@php.net> 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