20 public function __construct(
25 if($port < 0 or $port > 65535){
26 throw new \InvalidArgumentException(
"Invalid port range");
30 public function getIp() :
string{
34 public function getPort() :
int{
38 public function getVersion() :
int{
39 return $this->version;
42 public function __toString(){
43 return $this->ip .
" " . $this->port;
46 public function toString() :
string{
47 return $this->__toString();
51 return $this->ip === $address->ip and $this->port === $address->port and $this->version === $address->version;