testing search algorithms in js and php