PluginProbe
Authorizer / 3.13.4
Authorizer v3.13.4
3.15.3 3.15.2 3.15.1 3.15.0 3.14.3 3.14.4 3.14.2 3.14.1 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.9.0 2.9.1 2.9.10 2.9.11 2.9.12 2.9.13 2.9.2 2.9.3 2.9.6 All 126 releases
authorizer / polyfills.php

polyfills.php in Authorizer 3.13.4, at polyfills.php

32 lines 650 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Authorizer
4 *
5 * @license GPL-2.0+
6 * @link https://github.com/uhm-coe/authorizer
7 * @package authorizer
8 */
9
10 if ( ! function_exists( 'array_key_last' ) ) {
11 /**
12 * Polyfill for array_key_last(), used in class-cas.php. Not available in PHP
13 * versions below 7.3.
14 *
15 * Get the last key of the given array without affecting the internal array
16 * pointer.
17 *
18 * @param array $arr An array.
19 *
20 * @return mixed The last key of array if the array is not empty; NULL otherwise.
21 */
22 function array_key_last( $arr ) {
23 $key = null;
24 if ( is_array( $arr ) ) {
25 end( $arr );
26 $key = key( $arr );
27 }
28
29 return $key;
30 }
31 }
32