Surprisingly, on my Linux system, when connected to a localhost service using IPV4, stream_get_socket_name returns ::1 as the peer or local address. One would expect to get localhost or 127.0.0.1 but the ::1 IPV6 localhost is returned instead.
(PHP 5, PHP 7, PHP 8)
stream_socket_get_name — Yerel veya uzak soketin ismini döndürür
Belirtilen soket bağlantısının yerel veya uzak ismini döndürür.
Başarı durumunda soket ismi, başarısızlık durumunda false
döner.
Surprisingly, on my Linux system, when connected to a localhost service using IPV4, stream_get_socket_name returns ::1 as the peer or local address. One would expect to get localhost or 127.0.0.1 but the ::1 IPV6 localhost is returned instead.