Re: [PHP-DEV] [VOTE] User Defined Operator Overloads

2022-01-05 Thread Aleksander Machniak
On 03.01.2022 01:13, Jordan LeDoux wrote: https://wiki.php.net/rfc/user_defined_operator_overloads. The voting will close on 2022-01-17. - what is the performance impact? - why "[public] operator" and not "operator function"? - what about precedence, i.e. what happens with $a + $b * $c? there's

Re: [PHP-DEV] [VOTE] User Defined Operator Overloads

2022-01-05 Thread Jordan LeDoux
On Wed, Jan 5, 2022 at 12:26 AM Aleksander Machniak wrote: > > - what is the performance impact? > Each operator evaluation is very slightly better than the equivalent function call, since the VM call chain is very slightly simpler, but for most purposes you can think of the performance as being

Re: [PHP-DEV] [VOTE] User Defined Operator Overloads

2022-01-05 Thread Jordan LeDoux
On Tue, Jan 4, 2022 at 10:50 PM Pierre Joye wrote: > > I hesitated too, however I think we can't escape this feature. Like it > was for the annotation, we need to find a compromise. > > Your points are valid so I wonder if the RFC could be modified and get > to the point we could reach that compr

Re: [PHP-DEV] [VOTE] User Defined Operator Overloads

2022-01-05 Thread Andreas Heigl
Hey Jordan. On 05.01.22 10:42, Jordan LeDoux wrote: On Tue, Jan 4, 2022 at 10:50 PM Pierre Joye wrote: I hesitated too, however I think we can't escape this feature. Like it was for the annotation, we need to find a compromise. Your points are valid so I wonder if the RFC could be modified

Re: [PHP-DEV] [VOTE] User Defined Operator Overloads

2022-01-05 Thread Andreas Leathley
On 05.01.22 10:42, Jordan LeDoux wrote: I suppose the alternative would be to withdraw the RFC now that a wider variety of voters are providing feedback than the other three threads. I would let the vote go on, as there are still many voters who have not voted on this yet, giving the proposal m

Re: [PHP-DEV] [VOTE] User Defined Operator Overloads

2022-01-05 Thread Andreas Hennings
Hello Jordan, do you have any thoughts about these symmetric/left/right modifiers, to get rid of the $operandPos parameter? To me, the parameter could be the kind of thing where in hindsight we ask "why?". Also, can we drop the "public" modifier, if we do a new version of the RFC? Cheers Andreas

Re: [PHP-DEV] RFC: Trait expects interface

2022-01-05 Thread Rowan Tommins
On 04/01/2022 22:35, Kirill Nesmeyanov wrote: Since «traits» are often an indicator of not very good code and many may not use them quite correctly, for example, as helpers, I suggest adding support for the `expects` keyword to indicate that the trait is part of the code decomposition taking i

Re: [PHP-DEV] [VOTE] User Defined Operator Overloads

2022-01-05 Thread Jordan LeDoux
On Wed, Jan 5, 2022 at 6:33 AM Andreas Hennings wrote: > Hello Jordan, > do you have any thoughts about these symmetric/left/right modifiers, > to get rid of the $operandPos parameter? > > To me, the parameter could be the kind of thing where in hindsight we > ask "why?". > > Also, can we drop th

Re: [PHP-DEV] RFC: Trait expects interface

2022-01-05 Thread David Gebler
On Tue, Jan 4, 2022 at 10:35 PM Kirill Nesmeyanov wrote: > How relevant do you think this idea/proposal is? And what possible > problems or solutions will this entail in the future? > I'm not convinced there's a reasonable need for it. The very nature of finding yourself in a situation where you

Re: [PHP-DEV] [VOTE] User Defined Operator Overloads

2022-01-05 Thread Andreas Hennings
On Wed, 5 Jan 2022 at 20:11, Jordan LeDoux wrote: > > > > On Wed, Jan 5, 2022 at 6:33 AM Andreas Hennings wrote: >> >> Hello Jordan, >> do you have any thoughts about these symmetric/left/right modifiers, >> to get rid of the $operandPos parameter? >> >> To me, the parameter could be the kind of

Re: [PHP-DEV] RFC: Trait expects interface

2022-01-05 Thread Chase Peeler
On Wed, Jan 5, 2022 at 2:17 PM David Gebler wrote: > On Tue, Jan 4, 2022 at 10:35 PM Kirill Nesmeyanov wrote: > > > How relevant do you think this idea/proposal is? And what possible > > problems or solutions will this entail in the future? > > > > I'm not convinced there's a reasonable need for

Re: [PHP-DEV] [VOTE] User Defined Operator Overloads

2022-01-05 Thread Chase Peeler
On Wed, Jan 5, 2022 at 3:24 PM Andreas Hennings wrote: > On Wed, 5 Jan 2022 at 20:11, Jordan LeDoux > wrote: > > > > > > > > On Wed, Jan 5, 2022 at 6:33 AM Andreas Hennings > wrote: > >> > >> Hello Jordan, > >> do you have any thoughts about these symmetric/left/right modifiers, > >> to get rid

Re: [PHP-DEV] RFC: Trait expects interface

2022-01-05 Thread Larry Garfield
On Wed, Jan 5, 2022, at 2:35 PM, Chase Peeler wrote: > First, I'm someone that mainly uses traits to implement the functionality > defined in an interface. I think that's one of the best uses for them. > However, I'm personally not a huge fan of overly restrictive things. For > instance, while the

Re: [PHP-DEV] RFC: Trait expects interface

2022-01-05 Thread David Gebler
On Wed, Jan 5, 2022 at 11:05 PM Larry Garfield wrote: > On Wed, Jan 5, 2022, at 2:35 PM, Chase Peeler wrote: > > For point 2, that's mainly useful as a way to signal to other developers > "hey, this trait has all but one method of the LoggerInterface, that's how > you'd use it", and to signal sta

Re: [PHP-DEV] RFC: Stop to automatically cast numeric-string to int when using them as array-key

2022-01-05 Thread James Titcumb
On Wed, 29 Dec 2021, 15:42 Vincent Langlet, wrote: > > I recently discovered that an array was automatically casting > numeric-string keys to int if it was possible. > Having had to track down bugs numerous times over the years, I completely agree this is unexpected behaviour, and would be in fa