[wp-trac] [WordPress Trac] #45055: Introduce new PHP cross-version compatibility functions, `array_key_first()`, `array_key_last()`

WordPress Trac noreply at wordpress.org
Sat Oct 27 09:58:09 UTC 2018


#45055: Introduce new PHP cross-version compatibility functions,
`array_key_first()`, `array_key_last()`
-------------------------------+-----------------------------
 Reporter:  desrosj            |       Owner:  (none)
     Type:  feature request    |      Status:  new
 Priority:  normal             |   Milestone:  Future Release
Component:  General            |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  php73 needs-patch  |     Focuses:
-------------------------------+-----------------------------

Comment (by manzoorwani.jk):

 For `array_key_first`, `foreach` is faster than `reset` while as for
 `array_key_last`, `end` is faster than other approaches like `array_slice`
 or `array_keys` with `end`.

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


More information about the wp-trac mailing list