[wp-trac] [WordPress Trac] #51553: PHP 8.0: code improvements to allow for named parameters in function calls

WordPress Trac noreply at wordpress.org
Sat Jun 19 23:58:38 UTC 2021


#51553: PHP 8.0: code improvements to allow for named parameters in function calls
-------------------------------------------------+-------------------------
 Reporter:  jrf                                  |       Owner:  (none)
     Type:  task (blessed)                       |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  php8 has-patch 2nd-opinion dev-      |     Focuses:  coding-
  feedback needs-docs needs-codex                |  standards
-------------------------------------------------+-------------------------

Comment (by jrf):

 @azaozz I'm totally with you on that this is my least favourite "feature"
 in PHP 8.0, but that's not something we can change, so we just have to
 deal with it.

 I'm open to better names or better patterns, but the discrepancy between
 the parameter names in parent vs child classes *must* be solved for PHP 8
 compatibility as explained in the original issue description.

 The choice for the pattern of ''"generic" parameter name in declaration,
 renamed to the original, more specific and more descriptive name near the
 top of the function'', was made, as explained in the PR description to:
 1. preserve the more descriptive, self-documenting names, which make the
 rest of the code easier to understand
 2. minimize the code churn caused by the renames

 Not sure what more I can say. As I said before, I'm open to suggestions on
 how to solve this differently, but we do need to solve it.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51553#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list