Binary GCD algorithm php implementation. Iterative version.