forked from hans/Nominatim
Add array_key_last function for PHP <7.3
This patch adds an array_key_last function if it doesn't yet exist, fixes #2316. It is tested on PHP 7.2.24 but not PHP 7.3.
This commit is contained in:
committed by
Sarah Hoffmann
parent
63e35574d4
commit
fe39185894
@@ -227,3 +227,10 @@ function closestHouseNumber($aRow)
|
|||||||
|
|
||||||
return max(min($aRow['endnumber'], $iHn), $aRow['startnumber']);
|
return max(min($aRow['endnumber'], $iHn), $aRow['startnumber']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!function_exists('array_key_last')) {
|
||||||
|
function array_key_last(array $array)
|
||||||
|
{
|
||||||
|
if (!empty($array)) return key(array_slice($array, -1, 1, true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user