public function exists(Closure $predicate)
    {
        foreach ($this->collections as $key => $element) {
            if ($predicate($key, $element)) {
                return true;
            }
        }

        return false;
    }
public function exists(Closure $predicate)
    {
        foreach ($this->collections as $key => $element) {
            if ($predicate($key, $element)) {
                return true;
            }
        }

        return false;
    }
public function exists ( Closure $ predicate ) { foreach ( $ this -> collections as $ key => $ element ) { if ( $ predicate ( $ key , $ element ) ) { return true ; } } return false ; }
Tests for the existence of an element that satisfies the given predicate.

@param Closure $predicate The predicate.

@return bool TRUE if the predicate is TRUE for at least one element, FALSE otherwise.
Tests for the existence of an element that satisfies the given predicate .