[wp-trac] [WordPress Trac] #63853: Add PHP 8.5 compat array functions: `array_first` and `array_last`

WordPress Trac noreply at wordpress.org
Wed Aug 20 20:03:21 UTC 2025


#63853: Add PHP 8.5 compat array functions: `array_first` and `array_last`
-------------------------------+-------------------------------
 Reporter:  TobiasBg           |      Owner:  (none)
     Type:  enhancement        |     Status:  new
 Priority:  normal             |  Milestone:  6.9
Component:  General            |    Version:
 Severity:  normal             |   Keywords:  needs-patch php85
  Focuses:  php-compatibility  |
-------------------------------+-------------------------------
 PHP 8.5, expected to be released on November 20, 2025, thus shortly before
 WP 6.9, will bring two new array functions: `array_first` and
 `array_last`.

 See https://wiki.php.net/rfc/array_first_last

 Following up on [59783] (for #62558), [57337], and [52038], we should
 include polyfills in Core, to make developer adoption easier. For more
 reasoning, see ticket:62558#comment:6 .

 Further details as well as possible polyfills are available at
 https://php.watch/versions/8.5/array_first-array_last and in the
 [https://github.com/PHP-Polyfills/array-first-array-last polyfills/array-
 first-array-last] package.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63853>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list