Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 540 Bytes

any.md

File metadata and controls

34 lines (24 loc) · 540 Bytes

any

Description

Check if any value of the collection satisfies the function

This function is an alias for the some function

Parameters

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

Examples

Check if some value is bigger than 10:

<?php

use function Lambdish\Phunctional\any;

return any(
    function ($number) {
        return $number > 10;
    }, 
    [1, 4, 3, 9, 5]
);

// false