Simple implementation of Markov Chain for PHP