Re: [VOTE] Userspace operator overloading

From: Date: Wed, 25 Mar 2020 11:23:43 +0000
Subject: Re: [VOTE] Userspace operator overloading
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-109287@lists.php.net to get a copy of this message
> 1. This is exposing functionality that already exists for internal classes > 2. Because this just exposes existing functionality, the amount of > technical complexity this introduces is very small > > 3. As mentioned, this functionality already exists internally and is used > by GMP, where it works (imho) very well. > Thanks Nikita for the insights, that's really helpful. I'd suggest removing the "PHP_OPERAND_TYPES_NOT_SUPPORTED" constant and settle on null instead. The reason is visible in the RFC: `public static function __mul($lhs, $rhs): ?Vector3` - nothing else than null can be returned here when looking at the return type. Returning a const is just calling for "WTF" indirections IMHO. I'm still voting yes, hoping for this const to be removed after if the RFC passes, if it does :) Nicolas

« previous php.internals (#109287) next »