Completed
Push — master ( 6e3076...7fdc8a )
by Paweł
01:29
created

array_key_first()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
// For compatibility with PHP < 7.3
4
if (!function_exists('array_key_first')) {
5
    function array_key_first(array $arr) {
6
        foreach($arr as $key => $unused) {
7
            return $key;
8
        }
9
        return NULL;
10
    }
11
}
12