On Aug 7, 2021, at 15:28, Larry Garfield <la...@garfieldtech.com> wrote: > As an example here, time units. Adding two hour:minute time tuples together > to get a new time (wrapping at the 24 hour mark) is an entirely reasonable > thing to do. But multiplication and division on time doesn't make any sense > at all. Or, maybe it does but only with ints (2:30 * 3 = 7:30?), kind of, > but certainly not on the same type.
This touches on another important question -- how do we plan to represent: 1) An operator which is only applicable when an operator is used on two dissimilar types (e.g. TimeTuple x float)? 2) An operator which can be applied to an object, but with a primitive or otherwise non-extensible type on the left hand side of the operator (e.g. float x TimeTuple)? 3) An operator which can be used with multiple types, but whose meaning and/or return value can change based on what types are used (e.g. Matrix x Matrix vs. float x Matrix)? -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php