Skip to main content

Module net

Module net 

Source
Expand description

Network helpers: inet_pton/inet_ntop.

PHPRust
inet_pton($ip)inet_pton
inet_ntop($ip)inet_ntop

PHP’s address functions call the C library; the dev image is Alpine, so these are ports of musl’s inet_pton/inet_ntop (src/network/), whose IPv6 formatting differs from glibc’s in which zero run it compresses.

Structs§

NulByteError
PHP’s ValueError for a string argument that must not contain NUL bytes (Z_PARAM_PATH): "<function>(): Argument #1 ($ip) must not contain any null bytes".

Enums§

PackedAddr
A packed address from inet_pton.

Functions§

inet_ntop
PHP inet_ntop($ip): a 4-byte (IPv4) or 16-byte (IPv6) packed address in text form; None (PHP’s false) for any other length.
inet_pton
PHP inet_pton($ip): IPv6 when the string contains :, IPv4 when it contains ., None (PHP’s false) otherwise or when invalid.