Refactor of Bubble sort in php and adding some test