<?php namespace MyApp; use Ratchet\MessageComponentInterface; use Ratchet\ConnectionInterface; class Chat implements MessageComponentInterface { protected $clients; public function __construct() { $this->clients = new \SplObjectStorage (); } public function onOpen(ConnectionInterface $conn) { // Store the new connection to send messages to later $this->clients->attach ( $conn ); echo "New connecti