PHP Arrays are not a sensible data structure for such things. While implementing sorting algorithms is a good exercise, your functions have little use in a real application.
Fun Fact: I extended your test script to compare the results with sort(). On this data the internal quicksort of PHP performs 30 times faster than your implementation. Nothing wrong with your code, that's just because PHP does not give you access to low level data structures (though you might give it a try with SplFixedArray, which at least uses real arrays, not hashtables).
catalin - 2013-01-04 20:55:51 - In reply to message 1 from Fabian Schmengler
You are so right!
Was just an exercise to see how is working different sorting algorithms in PHP.
And actually I wanted to compare those algorithms in PHP as relative performance (I didn't have intention to compare with same algorithms in C).