Hello,

I did some tests and in fact it seems you're right. Thank you for letting me 
know, didn't know!


Best regards,
Benas Seliuginas

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Friday, April 24, 2020 6:44 PM, Marco Pivetta <ocram...@gmail.com> wrote:

> Hey moliata,
>
> On Fri, Apr 24, 2020 at 5:27 PM moliata moli...@protonmail.com wrote:
>
> > 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?
>
> The only limitation right now is`resource`: `callable` is always either an
> `array`, a `string` or an `object` that implements `__invoke`, so
> `callable` is a subtype of the union type mentioned few posts above.
>
> Marco Pivetta
>
> http://twitter.com/Ocramius
>
> http://ocramius.github.com/

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to