PHP Quicksort implementation