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

WordPress Trac noreply at wordpress.org
Wed Nov 11 21:25:13 UTC 2020


#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:  5.6
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  2nd-opinion php8 needs-dev-note      |     Focuses:  coding-
  has-patch                                      |  standards
-------------------------------------------------+-------------------------

Comment (by jrf):

 Thanks @johnbillion and @desrosj for chiming in.

 > I would support a statement on make/core that the project cannot
 guarantee there will be no changes to parameter names after 5.6, and
 anybody who chooses to immediately start using named parameters with PHP 8
 needs to expect such changes in the short term.

 I'd suggest taking that one step further and would like to recommend very
 explicitly stating that "WP will NOT support named parameters for the time
 being and that it will be announced when this will be supported at a later
 point in time".

 > That said, after some cursory searching I've not found a similar
 statement from any other PHP project,

 A lot of projects have already been reviewing and renaming parameters in
 anticipation of PHP 8, including projects like PHP itself, PHPUnit
 PHPOffice etc.

 Other projects may not have started their PHP 8 efforts yet.

 > I don't think that tasks 1 and 2 are realistic for 5.6.

 Task 1 is already finished for all WP native classes. See the attached
 patch I created four weeks ago.

 > explicitly recommending against using named parameters when utilizing
 WordPress Core functions and classes until tasks 1 and 2 can be completed

 :+1:

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


More information about the wp-trac mailing list