clients[] = $a; return $b; } /** * {@inheritDoc} * * @return boolean */ public function isOpen(): bool { return true; } /** * {@inheritDoc} * * @param mixed $data * @return bool */ public function send($data):bool { foreach ($this->clients as $i=>$client) { if (false === $client->send($data)) { unset($this->clients[$i]); } } return true; } /** * {@inheritDoc} * * @return mixed */ public function receive() { foreach ($this->clients as $client) { if ($read = $client->receive()) { return $read; } } return false; } }