array_key_last( array $arr )
Polyfill for array_key_last()
function added in PHP 7.3.
Description
Get the last key of the given array without affecting the internal array pointer.
Parameters
- $arr
-
(array) (Required) An array.
Return
(string|int|null) The last key of array if the array . is not empty; null
otherwise.
Source
File: wp-includes/compat.php
function array_key_last( array $arr ) { if ( empty( $arr ) ) { return null; } end( $arr ); return key( $arr ); }
Expand full source code Collapse full source code View on Trac View on GitHub
Changelog
Version | Description |
---|---|
5.9.0 | Introduced. |