Demo code on matrix rotations in PHP using best design practices