← All docs

getservbyport()

Gets the Internet service that corresponds to a port and protocol.

getservbyport()

function getservbyport(int $port, string $protocol): mixed

Gets the Internet service that corresponds to a port and protocol.

Parameters:

  • $port (int)
  • $protocol (string)

Returns: mixed

Availability

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how getservbyport is implemented in the compiler, see the internals page.