PHP implementation of the Snake-in-the-box problem