Applies the given predicate p to all elements of this collection, returning true, if the predicate yields true for all elements.
Closure $p The predicate.:
boolean TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.
Overrides Collection::forAll
public function forAll(Closure $p) {
foreach ($this->_elements as $key => $element) {
if (!$p($key, $element)) {
return false;
}
}
return true;
}