Basically, I want to be able to get the functionality of C++’s find_if(), Smalltalk’s detect: etc.: But I don’t know of any PHP function which does this. One “approximation” I came up with: The downside of this is that the code’s purpose is not immediately clear. Also, it won’t stop iterating over the array even if the element was found,