$value ); } public static function isOpen(string $host, int $port = -1, ?float $timeout = null, int &$error_code = null, string &$error_message = null): bool { if (self::isHost($host) && self::isPort($port)) { $connection = @fsockopen( self::isIPv6($host) ? "[$host]" : $host, // PHP is shit 💩. $port, $error_code, $error_message, $timeout ); if (is_resource($connection)) { return fclose( $connection ); } } return false; } }