Re: [PHP-DEV] Typed callable properties

2020-04-24 Thread moliata
point about union types is invalid. Best regards, Benas Seliuginas ‐‐‐ Original Message ‐‐‐ On Wednesday, April 22, 2020 7:56 PM, moliata wrote: > Hello, > > thank you for your opinion. In response to you mentioning that fixing this > problem would be a huge amount of work

Re: [PHP-DEV] [RFC] Mixed type

2020-04-24 Thread moliata
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 wrote: > Hey moliata, > > On Fri, Apr 24, 2020 at 5

Re: [PHP-DEV] [RFC] Mixed type

2020-04-24 Thread moliata
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 fa

Re: [PHP-DEV] [RFC] Mixed type

2020-04-24 Thread moliata
I personally would stick to `mixed`. It's used extensively in the official PHP documentation and has grown with the language. Heck, even static analysis tools and billions of PHPDoc comments (e. g. Laravel, CakePHP, Yii) use `mixed` type. Switching to `any` just doesn't feel right. Oh and well, I

Re: [PHP-DEV] Typed callable properties

2020-04-22 Thread moliata
oned, all we can do is specify that we accept any callable. Best regards, Benas Seliuginas ‐‐‐ Original Message ‐‐‐ On Wednesday, April 22, 2020 8:39 PM, Michał Brzuchalski wrote: > Hi Benas, > > my responses below. > > śr., 22 kwi 2020 o 19:17 moliata napisał(a): >

Re: [PHP-DEV] Typed callable properties

2020-04-22 Thread moliata
Hello, thank you for the comment! Yes, indeed I was raising a discussion on whether we should allow making typed callable properties for improved language's consistency (given that parameter/return type hints can be set to callable). As one of the solutions, I mentioned that we could just ignore t

Re: [PHP-DEV] Typed callable properties

2020-04-22 Thread moliata
sage ‐‐‐ On Wednesday, April 22, 2020 6:01 PM, Michał Brzuchalski wrote: > Hi all, > > śr., 22 kwi 2020 o 16:29 Dan Ackroyd napisał(a): > >> On Tue, 21 Apr 2020 at 14:08, moliata wrote: >>> >> >>> I wanted to ignite a friendly discussion whether >

Re: [PHP-DEV] Typed callable properties

2020-04-22 Thread moliata
pril 22, 2020 5:29 PM, Dan Ackroyd wrote: > On Tue, 21 Apr 2020 at 14:08, moliata moli...@protonmail.com wrote: > > > > > > I wanted to ignite a friendly discussion whether > > PHP should allow typed callable properties. > > IMO no. > > Trying to fix the pr

Re: [PHP-DEV] Typed callable properties

2020-04-21 Thread moliata
Thank you for letting me know! I'm not sure if I can do something though, given that I'm using ProtonMail. Best regards, Benas Seliuginas Sent with ProtonMail Secure Email. ‐‐‐ Original Message ‐‐‐ On Tuesday, April 21, 2020 7:55 PM, Ben Ramsey wrote: > > On Apr 21, 2020, at 07:56, L

[PHP-DEV] Typed callable properties

2020-04-21 Thread moliata
Hey internals, I wanted to ignite a friendly discussion whether PHP should allow typed callable properties. The problem arises as typed properties RFC did not allow the callable type [1] due to its context-dependent behaviour. As such, for improving the language's consistency and adding support fo

[PHP-DEV] Typed callable properties

2020-04-21 Thread moliata
Hey internals, I wanted to ignite a friendly discussion whether PHP should allow typed callable properties. The problem arises as typed properties RFC did not allow the callable type [1] due to its context-dependent behaviour. As such, for improving the language's consistency and adding support