Implementation of popular algorythms in php