function transpose($m) {
  if (count($m) == 0) 
    return array();
  else if (count($m) == 1) 
    return array_chunk($m[0], 1);

  
  array_unshift($m, NULL); 
  return call_user_func_array('array_map', $m);
}