An auxiliary recursive function that sorts the input array and returns the number of inversions in the array .
function _mergeSort ( & $ arr , & $ temp , $ left , $ right ) { $ inv_count = 0 ; if ( $ right > $ left ) {