[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 30 14:14:05 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:"55162" 55162]:
 {{{
 #!CommitTicketReference repository="" revision="55162"
 Code Modernization: Rename parameters that use reserved keywords in `wp-
 includes/formatting.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 `$class` parameter to `$classname` in
 `sanitize_html_class()`.

 Follow-up to [54927].

 See also:
 [search:?q=code+modernization+rename+parameters+that+use+reserved+keywords&changeset=on
 equivalent commits for other files].

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

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


More information about the wp-trac mailing list