Re: Revisiting Userland Operator Overloads

From: Date: Sat, 07 Aug 2021 17:48:52 +0000
Subject: Re: Revisiting Userland Operator Overloads
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-115654@lists.php.net to get a copy of this message
On Fri, 6 Aug 2021 at 21:18, Scott Arciszewski <scott@paragonie.com> wrote: > > It's probably worth exploring whether common combinations are worth > defining for convenience. > My understanding of the current consensus is "let's not". That's based from the discussion on whether defining 'number' as 'int | float' would be worth doing, mostly because adding aliases don't provide much value, and once you've started adding some, where do you stop? e.g. if we defined 'number' why not also define 'scalar'? The value for interfaces is even lower than other types, as it's already possible in userland to define your own combination types: interface MatrixMath extends __AddInterface, __AddSubInterface, __AddMulInterface {} as interfaces can extend multiple other interfaces at once. cheers Dan Ack

« previous php.internals (#115654) next »