我需要$tempobjects
从数组中排除数组的元素$objects
。最快的方法是什么?
$objects = new MyObjects();
$tempobjects = new MyObjects();
for($i=0; $i<10; $i++) {
$objects->addObject(new MyObject(...));
}
//...fill $tempobjects with some temporary data
$tempobjects = $objects - $tempobjects; // HOW TO DO SOMETHING LIKE THIS?