No. If you often need a quick direct search for values, you need to use the array keys for them, which are quickly updated for the search. For instance:
$indexed = array();
foreach ($array as $object) {
$indexed[$object->id] = $object;
}
if (isset($indexed[42])) {
}
If you need to search for objects with different keys, so you cannot index them by one specific key, you need to look for different search strategies, such as binary search .