1.2.0
1.2.0
To allow search in both first
or last
to get the key instead of the row:
$data = [1, 2, 3];
$filter = static fn($datum): bool => $datum >= 1;
// RETURN the Array key, pass true to 3rd arg
var_dump(\ArrayLookup\Finder::first($data, $filter, true)) // 0
// RETURN the Array key, pass true to 3rd arg
var_dump(\ArrayLookup\Finder::last($data, $filter, true)) // 2