<?php get_defined_constants(bool $categorize = false): array
<?php public static function errno($errstr) { if (\function_exists('socket_strerror')) { foreach (\get_defined_constants(false) as $name => $value) { if (\strpos($name, 'SOCKET_E') === 0 && \socket_strerror($value) === $errstr) { return $value; }
<?php public static function errconst($errno) { if (\function_exists('socket_strerror')) { foreach (\get_defined_constants(false) as $name => $value) { if ($value === $errno && \strpos($name, 'SOCKET_E') === 0) { return ' (' . \substr($name, 7) . ')'; }