[wp-trac] [WordPress Trac] #56788: PHP 8.0: improvements to allow for named parameters in WP 6.2

WordPress Trac noreply at wordpress.org
Mon Jan 23 15:52:33 UTC 2023


#56788: PHP 8.0: improvements to allow for named parameters in WP 6.2
-------------------------------------------+-----------------------------
 Reporter:  SergeyBiryukov                 |       Owner:  SergeyBiryukov
     Type:  task (blessed)                 |      Status:  accepted
 Priority:  normal                         |   Milestone:  6.2
Component:  General                        |     Version:
 Severity:  normal                         |  Resolution:
 Keywords:  php8 has-patch has-unit-tests  |     Focuses:
-------------------------------------------+-----------------------------

Comment (by SergeyBiryukov):

 In [changeset:"55117" 55117]:
 {{{
 #!CommitTicketReference repository="" revision="55117"
 Code Modernization: Rename parameters that use reserved keywords in `wp-
 includes/functions.php`.

 While using reserved PHP keywords as parameter name labels is allowed, in
 the context of function calls using named parameters in PHP 8.0+, this
 will easily lead to confusion. To avoid that, it is recommended not to use
 reserved keywords as function parameter names.

 This commit:
 * Renames the `$array` parameter to `$input_array` in
 `wp_recursive_ksort()`.
 * Moves the function next to other array-related functions for
 consistency.

 Follow-up to [53129], [54929].

 Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
 See #56788.
 }}}

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


More information about the wp-trac mailing list