How would i combine these functions

	function foo($y){
		global $Arr;
		$i = 0;
		 foreach($Arr[$y] as $Obj){
 			$i += $Obj->func1();
 		}

 		return i;
	}
	
	
	function bar($year){
		global $Arr;
		$i = 0;
	 	foreach($Arr[$y] as $Obj){
 			$i += $Obj->func2();
 		}
 		return i;
	}

The only difference is that they call different function in the foreach loop. Is there any way to combine these? I can do it by passing in a boolean parameter and doing one or the other but i was wondering PHP has something more specific to my need. I have looked but no luck so far.

Thanks,
Nick

function bar($y, $method)
{
    global $Arr;
    $i = 0;
    foreach($Arr[$y] as $Obj){
        $i += $Obj->$method();
    }
     return $i;
}

// call like:
$i = bar(2011, 'func1');


$i = array_reduce($Arr[2011],create_function('$v,$w','return $v + w->func1();'),0);
$i = array_reduce($Arr[2011],create_function('$v,$w','return $v + w->func2();'),0);

array_reduce()

That is perfect, thank you, i dident know you could use variables for method calls like that, i assumed it would think i was trying to call a string as a method.