On 13 March 2023 18:44:48 GMT, Robert Landers <landers.rob...@gmail.com> wrote: >My approach was more of an iterative one. > >1. Get left-right done so that > >$x = something($left, $right, ...); > >would be allowed, but not > >$x = something($left, ..., $right); > >This would bring some immediate benefits, as initially proposed.
There are three problems I see with that: 1) The choice of syntax for the first version immediately limits the options for later additions, so you still need to discuss them. (IIRC, the proposal that went to vote had separate ? and ... tokens, but a number of different variations were experimented with.) 2) Most of the goals I mentioned above are not about the syntax, and are no easier for left-to-right - for instance, copying the type information for use in reflection and error messages. 3) Unlike purely or primarily functional languages, PHP's standard library is not at all designed with parameter orders that lend themselves to left-to-right application. I gave array_filter as an example, because it's exactly the kind of function people will want to use PFA for, but wouldn't be able to with left-to-right only. I don't want to put you off exploring this idea, though, so feel free to take this all with as many pinches of salt as you want. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php