CURLOPT_PREREQFUNCTION

ConstantAdded in PHP 8.4

CURLOPT_PREREQFUNCTION is one of the accepted parameters for curl_setopt parameter #2.

CURLOPT_PREREQFUNCTION — A callable with the following signature that gets called after the connection is established, but before the request payload (for example, the GET/POST/DELETE request of an HTTP connection) is sent, and can be used to abort or allow the connection depending on the source and destination IP address and port numbers:

 Return [`CURL_PREREQFUNC_OK`](/codex/CURL_PREREQFUNC_OK) to allow the request, or
 [`CURL_PREREQFUNC_ABORT`](/codex/CURL_PREREQFUNC_ABORT) to abort the transfer.
 Available as of PHP 8.4.0 and cURL 7.80.0.
PHP 5
PHP 7
PHP 8.0
PHP 8.1
PHP 8.2
PHP 8.3
PHP 8.4
Added
PHP 8.5
CURLOPT_PREREQFUNCTION = 20312;

Changes to the CURLOPT_PREREQFUNCTION Constant

PHP 8.4

  • Constant added

CURLOPT_PREREQFUNCTION Constant Availability

PHP VersionAvailability
PHP 8.5Future Release Yes
PHP 8.4Upcoming Release Yes
PHP 8.3Supported (Latest) No
PHP 8.2Supported No
PHP 8.1Security-Fixes Only No
PHP 8.0Unsupported No
PHP 7.4Unsupported No
PHP 7.3Unsupported No
PHP 7.2Unsupported No
PHP 7.1Unsupported No
PHP 7.0Unsupported No
PHP 5.6Unsupported No
PHP 5.5Unsupported No
PHP 5.4Unsupported No
PHP 5.3Unsupported No