_id = (string)$socket->getResource(); $this->_id = (int)substr($this->_id, strrpos($this->_id, '#') + 1); } /** * @return int */ public function getID() { return $this->_id; } public function set($name, $val) { $this->_data[$name] = $val; } public function get($name) { if (!isset($this->_data[$name])) { throw new \UnexpectedValueException("Attribute '{$name}' not found in Connection {$this->getID()}"); } return $this->_data[$name]; } }