> > I see, I understand. > > But I don't think that's wise. For example, if we reversed the order of > the div and mod, there would be no cache and we wouldn't get the speed > boost. (Or does it cache the quotient as well?) >
I don't think the cache is a good idea either, for the reasons you mentioned. I predicted this would probably be on the agenda. Another idea is to pass > arguments by reference, like in `exec()`. > > Personally, I find something like a tuple easier to use. However, without > generics, all we know is that the return type is an array, which may be > inconvenient in terms of IDE completion, etc. > As for tuple vs reference, I think the general direction is to move away from references as much as possible, and AFAIK references actually make things harder for IDEs and static analysis tools, whereas the tuple syntax array{string, string} is well understood at least by PhpStorm, Psalm and PHPStan, which can correctly type the function's return value in their stubs. — Benjamin