I just found a lovely gem of code while doing routine maintenance on a system. The system pings a bunch of places for values, puts them all into an array, and then "sells" it's item to the place that returned the highest price.
The code here gathers all the objects into an array and grabs the highest one.
I can't actually paste the code, but here's what he was doing:
Grab Array
Copy into new array
Bubble sort the array!!! Using his own bubble sort implementation!!
something like $max = array[sizeof(array))] to get the last element.
return $max
Should I tell him that PHP has a built in function for finding the largest element of an array, or should I marvel at his own implementation of bubble sort?