Kata Tennis PHP possible solution