Re: [RFC] Alternative "use" syntax for Closures

From: Date: Sun, 16 Jun 2019 13:04:32 +0000
Subject: Re: [RFC] Alternative "use" syntax for Closures
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-105952@lists.php.net to get a copy of this message
Hi, On 15.06.19 23:53, Wes wrote:
https://wiki.php.net/rfc/alternative-closure-use-syntax
Thanks for the RFC and effort,
I know it seems overkill and wrong to have two different syntaxes for the same thing, but I really believe that's all we need to fix one of the most hated PHP syntax bits.
Technically, no versions seems better than the other. Personally I don't see how this fixes anything but introduces two ways of doing the same thing. I've never really seen people having problems with the current syntax but I'm not saying there aren't. The same argument can be made for all the array/str function and people having a hard time to remember which function takes theneedle/haystack and what argument position or similar to map/reduce/etc. From the RFC:
Specifically, it requires a lot of effort to write compared to normal expressions.
This are bold words: "a lot". The problem with this argument is that there's almost no way to properly argue for or against this. This is like art and creativity: it's a personal choice and some like it, some not. Choice is nice and all, but in terms of code style it just creates an overhead (= decision to make which style to use) and I rather prefer "one true" way of doing things unless absolute necessary. I'm -1 on introducing a 2nd syntax without clear benefits of any kind that I can see. That syntax exists now for 10 years, I'd say people can and do accommodate and there's no need for this. thanks, - Markus

« previous php.internals (#105952) next »