Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 495 Bytes

File metadata and controls

32 lines (23 loc) · 495 Bytes

all

Description

Check if all the values of the collection satisfies the function

Parameters

fn
Function to check if the predicate is true.
coll
Collection of values to check all are true by the `$fn`.

Examples

Check if all the values are bigger than 10:

<?php

use function Lambdish\Phunctional\all;

return all(
    function ($number) {
        return $number > 10;
    }, 
    [9, 40, 30, 90, 50]
);

// false