Iterates over each value in the collection. If the current value is not null, is returned into the result collection. Keys are preserved.
- coll
- Collection of values to be filtered.
Filter nulls from a collection:
<?php
use function Lambdish\Phunctional\filter_null;
return filter_null(
[1, null, 20, 3, 40, null, 5]
);
// => [1, 20, 3, 40, 5]