WpOrg\Requests\Utility
InputValidator::is_curl_handle
Verify whether a received input parameter is a Curl handle.
The PHP Curl extension worked with resources prior to PHP 8.0 and with an instance of the CurlHandle class since PHP 8.0. https://www.php.net/manual/en/migration80.incompatible.php#migration80.incompatible.resource2object
Method of the class: InputValidator{}
No Hooks.
Returns
true|false.
Usage
$result = InputValidator::is_curl_handle( $input );
- $input(mixed) (required)
- Input parameter to verify.
InputValidator::is_curl_handle() InputValidator::is curl handle code WP 7.1
public static function is_curl_handle($input) {
if (is_resource($input)) {
return get_resource_type($input) === 'curl';
}
if (is_object($input)) {
return $input instanceof CurlHandle;
}
return false;
}