Toy chat protocol in PHP