Skip to content

1.3.0

Compare
Choose a tag to compare
@samsonasik samsonasik released this 14 Jan 11:38
· 61 commits to main since this release
1.3.0
a387403

1.3.0

ci build Code Coverage PHPStan

Add $preserveKey flag ability to not preserve key on Finder::last()

$data = [6, 7, 8, 9];
$filter = static fn ($datum): bool => $datum > 5;

// RETURN the Array key, pass true to 3rd arg

// ... with PRESERVE original key
var_dump(\ArrayLookup\Finder::last($data, $filter, true)); // 3

// ... with RESORT key, first key is last record, pass false to 4th arg
var_dump(\ArrayLookup\Finder::last($data, $filter, true, false)); // 0