On Mon, June 29, 2020 at 10:13 AM Nikita Popov <nikita....@gmail.com> wrote:

> On Tue, Jun 23, 2020 at 12:10 PM Nikita Popov <nikita....@gmail.com> wrote:
> 
> > As we're moving in on feature freeze, I plan to move this proposal forward
> > soonishly.
> >
> > I have update the RFC to drop the syntax as an open question (I haven't
> > seen much opposition to the use of ":"), and to describe the possible
> > alternative LSP behavior at
> > https://wiki.php.net/rfc/named_params#parameter_name_changes_during_inheritance.
> >
> > While writing this down and implementing it, I found that this has more
> > odd edge-cases than anticipated. Overall, I'm not sold that this approach
> > is worth it. It sounds nice on paper, but I strongly suspect that it solves
> > a problem that does not existing in practice, and will force us to keep
> > this patch-over mechanism indefinitely, while the real solution would have
> > been to fix the limited amount of code that is in the intersection of
> > "renames parameters" and "is actually invoked with named arguments".
> 
> Just as another reminder: I plan to put this to voting by the end of the
> week.
> 
> I've also updated the RFC to make the LSP behavior a secondary vote. I'm
> not convinced this is a good idea myself, but some others seemed to prefer
> this approach.

Hi Nikita,

Thanks for moving this forward. Currently I work with a lot of value
objects which are constructed from an associative array (requiring
lots of manual validation), and named arguments will make it feasible
to migrate most of these to simple typed parameters that can be
statically analyzed instead. For me at least this will be one of the
nicest features in PHP 8.

I'm also looking forward to the potential future shorthand syntax
for matching parameter and variable names, which could also reduce
boilerplate in array construction and destructuring.

I'll probably vote No on the secondary "Automagically allow using
parent parameter names?" vote. This is a feature that could always be
added later without a BC break, but if it's added now it would be
hard to remove if the extra complexity causes problems. For these
rare cases it's probably better to update the parameter names to
match or stick with normal sequential arguments.

Best regards,
Theodore

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

Reply via email to