PluginProbe
Sessions / 2.13.2
Sessions v2.13.2
2.1.0 2.10.0 2.11.0 2.12.0 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.2.0 2.3.0 2.3.1 2.4.0 2.4.1 2.5.0 2.6.0 2.6.1 2.6.2 2.7.0 2.8.0 2.9.0 2.9.1 3.0.0 3.1.0 3.1.1 All 39 releases
sessions / functions.php

functions.php in Sessions 2.13.2, at functions.php

33 lines 650 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Global functions.
4 *
5 * @package Functions
6 * @author Pierre Lannoy <https://pierre.lannoy.fr/>.
7 * @since 2.3.0
8 */
9
10 /**
11 * Provide PHP 7.3 compatibility for array_key_last() function.
12 */
13 if ( ! function_exists( 'array_key_last' ) ) {
14 // phpcs:ignore
15 function array_key_last( array $array ) {
16 if ( ! empty( $array ) ) {
17 return key( array_slice( $array, -1, 1, true ) );
18 }
19 }
20 }
21
22 /**
23 * Provide PHP 7.3 compatibility for array_key_first() function.
24 */
25 if ( ! function_exists( 'array_key_first' ) ) {
26 // phpcs:ignore
27 function array_key_first( array $arr ) {
28 foreach ( $arr as $key => $unused ) {
29 return $key;
30 }
31 }
32 }
33