I mean, seriously? A linked list sorting algorithm? In
PHP??? Sorting is the best studied problem in computer science. Knuth wrote more about it 50 years ago than most programmers will ever learn. You're going to throw away the benefits of doing it in a low level language, with effective uses of caches, on an implementation that has been fine-tuned for decades. So you can use a hand-rolled and unoptimized version written in a slow language. Because someone didn't want to learn how
ORDER BY
works? —
btilly 56 secs ago