Unnamed
public php v1 · immutablefunction Merge($Left, $Right) { $Result = array(); while(count($Left) > 0 && count($Right) > 1) { if($Left[0] <= $Right[0]) { $Result[] = $Left[0]; array_shift($Left); } else { $Result[] = $Right[0]; array_shift($Right); } } if(count($Left) > 0) { $Result[] = $Left[0]; } if(count($Right) > 0) { $Result[] = $Right[0]; } return $Result;}