getNamePart() публичный статический Метод

PHP seems to return IPV6 address/port combos like this: ::1:1234, where ::1 is the address and 1234 the port So, the part number here is either the last : delimited section (the port) or all the other sections (the whole initial part, the address).
public static getNamePart ( string $name, $part ) : string
$name string (from $this->getName() usually)
Результат string
Пример #1
0
 /**
  * @dataProvider getValidNames
  * @param string $name
  */
 public function testGetNamePart($name, $ip, $port)
 {
     $this->assertEquals($ip, Socket::getNamePart($name, Socket::NAME_PART_IP), 'splits ip correctly');
     $this->assertEquals($port, Socket::getNamePart($name, Socket::NAME_PART_PORT), 'splits port correctly');
 }