Python has a nice all()
(doc) method that returns true if all elements in an iterable are true, which is equivalent to:
def all(iterable):
for element in iterable:
if not element:
return False
return True
Is there a similarly nice way to do this in PHP?