|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).