WordPress at Your Fingertips
function is not described

Requests_Transport_fsockopen::test() public WP 1.0

Whether this transport is valid

{} It's a method of the class: Requests_Transport_fsockopen{}

No Hooks.

Return

true|false. True if the transport is valid, false otherwise.

Usage

$result = Requests_Transport_fsockopen::test( $capabilities );
$capabilities **
-
Default: array()

Code of Requests_Transport_fsockopen::test() WP 5.7.2

<?php
public static function test($capabilities = array()) {
	if (!function_exists('fsockopen')) {
		return false;
	}

	// If needed, check that streams support SSL
	if (isset($capabilities['ssl']) && $capabilities['ssl']) {
		if (!extension_loaded('openssl') || !function_exists('openssl_x509_parse')) {
			return false;
		}

		// Currently broken, thanks to https://github.com/facebook/hhvm/issues/2156
		if (defined('HHVM_VERSION')) {
			return false;
		}
	}

	return true;
}