* * SPDX-License-Identifier: MIT * * This file contains functions that allow us to use convenient functions from * later PHP versions in earlier versions where these functions may not be * supported directly. */ if (!function_exists('array_find')) { // array_find is defined in PHP 8.4 or higher, so for earlier PHP versions we // define it here. function array_find(array $array, callable $callback): mixed { foreach ($array as $key => $entry) { if ($callback($entry, $key) === true) { return $entry; } } return null; } }