Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 465 Bytes

filter_null.md

File metadata and controls

27 lines (19 loc) · 465 Bytes

filter_null

Description

Iterates over each value in the collection. If the current value is not null, is returned into the result collection. Keys are preserved.

Parameters

coll
Collection of values to be filtered.

Examples

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]