Insertion and selection sort in PHP
One possible inefficiency is that you are copying the array when you call the function.  If you pass parameters by reference, then you could avoid allocating and copying the array.  See the difference in these two functions that just perform one swap:

function f($a) {
    $swap = $a[0];
    $a[0] = $a[1];
    $a[1] = $swap;
    return $a;
}

function g(&amp;$a) {
    $swap = $a[0];
    $a[0] = $a[1];
    $a[1] = $swap;
}

$xyz = array('x', 'y', 'z');
print_r($xyz);                  # array { [0] =&gt; x  [1] =&gt; y  [2] =&gt; z }
$yxz = f($xyz);
print_r($xyz);                  # array { [0] =&gt; x  [1] =&gt; y  [2] =&gt; z }
print_r($yxz);                  # array { [0] =&gt; y  [1] =&gt; x  [2] =&gt; z }
g($xyz);
print_r($xyz);                  # array { [0] =&gt; y  [1] =&gt; x  [2] =&gt; z }




That aside, there is not that much you can do to optimize your two sorting algorithms.  You could try obtaining the length count($sort_array) just once, before the loop, to see if makes any difference.

The important thing to note, though, is that both insertion sort and selection sort are O(n2) algorithms.  That means that if you double the size of the array, it will take approximately quadruple the amount of time to complete the sort.  If you care about performance when sorting large lists, you don't use insertion sort or selection sort.  You pick a more efficient algorithm that tends to work in O(n log n) time, such as quicksort.

Comparing performance across languages is not a very useful way to judge the quality of your code.  To make a comparison that is at least somewhat fair, try racing against PHP's own array_sort() function.