PHP almost always passes by value, rather than by reference.
You might see if array_map or array_filter work for you. Generally speaking, native code is faster than scripted code 🙂
Or if you want a manual loop
foreach(keys($objarray) as $key)
{ $objarray[$key]->method();
}
should work for any sort of array, but if your $objarray is indexed and it doesn't, then
for($i=0; $i<count($objarray); ++$i)
{ $objarray[$i]->method();
}
oughta.
See also the PHP manual on references - it probably knows more about this bit of the langauge than I do 🙂