On Fri, Apr 24, 2020 at 2:12 PM Bob Weinand <bobw...@hotmail.com> wrote:
> Mixed is in almost every case just patching the holes in PHPs type system. > And as such, I'd rather promote RFCs trying to properly fix the gaps in the > type system than supporting mixed. > > Mixed is a hack, do not use mixed. > Heya Bob, I maintain lots of legacy code and I cannot add return types despite being truly mixed. Mixed is not a hack, it's a scenario that frequently happens. There are lots of use-cases where we explicitly want to mark it as such as it truly accepts anything. Would I use it in new code? Pretty much never, as `string|int` would already cover the majority of cases, especially where ints are represented by strings. I would love to see mixed being added as it lets me remove a lot of docblocks that are only added so I can indicate mixed. I disagree that it's patching holes, it's filling a gap that's currently missing something. Regards, Lynn