$array = array( 1 => 'Сергей', 2 => function($name){ return $name; } );
foreach($array as $key => $value){ $value = (is_callable($value) ? call_user_func($value, 'Иван') : $value); echo $key.'. '.$value.'<br>'; }