diff options
Diffstat (limited to 'lib/php8backports.php')
-rw-r--r-- | lib/php8backports.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/php8backports.php b/lib/php8backports.php index 30dfdbd9..5b103e3d 100644 --- a/lib/php8backports.php +++ b/lib/php8backports.php @@ -54,3 +54,13 @@ if (!function_exists('str_contains')) { return $needle !== '' && mb_strpos($haystack, $needle) !== false; } } + +if (!function_exists('array_is_list')) { + function array_is_list(array $arr) + { + if ($arr === []) { + return true; + } + return array_keys($arr) === range(0, count($arr) - 1); + } +} |