Actually, it's not quite possible to declare a `mixed` type using union types given that it's not possible to make properties as callable (please take a look at my "Typed callable properties" post in the mailing list). As such, if we wanted to make a property hold a callable, we would have to fallback to just not using a type hint at all.
Correct me if I'm wrong but this behavior is addressed in the RFC and we can pass callables to properties that are declared as `mixed`, right? Best regards, Benas Seliuginas ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Friday, April 24, 2020 6:09 PM, Matthew Brown <matthewmatt...@gmail.com> wrote: > > How much would you like/be adverse to a rector rule that changes `mixed` > > into a long union type (without `resource` in it)? > > > Considering above posts, `mixed` is effectively > > `null|bool|string|int|float|array|object|resource`, > > At runtime those things are effectively the same, but in the world of types > mixed has its own distinct meaning – I'd be very averse to any sort of > corresponding replacement. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php