Merge sort implemented in PHP