(Pierrick)
. Implemented FR #77711 (CURLFile should support UNICODE filenames). (cmb)
. Deprecated CURLPIPE_HTTP1. (cmb)
+ . Deprecated $version parameter of curl_version(). (cmb)
- Date:
. Fixed bug #75232 (print_r of DateTime creating side-effect). (Nikita)
Previously the exception was only thrown on unserialization.
. Using CURLPIPE_HTTP1 is deprecated, and is no longer supported as of cURL
7.62.0.
+ . The $version parameter of curl_version() is deprecated. If any value not
+ equal to the default CURLVERSION_NOW is passed, a warning is raised and the
+ parameter is ignored.
- Date:
. Calling var_dump() or similar on a DateTime(Immutable) instance will no
PHP_FUNCTION(curl_version)
{
curl_version_info_data *d;
- zend_long uversion = CURLVERSION_NOW;
+ zend_long uversion = -1;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
Z_PARAM_LONG(uversion)
ZEND_PARSE_PARAMETERS_END();
- d = curl_version_info(uversion);
+ if (uversion == CURLVERSION_NOW) {
+ php_error_docref(NULL, E_DEPRECATED, "the $version parameter is deprecated");
+ } else if (ZEND_NUM_ARGS() > 0) {
+ php_error_docref(NULL, E_WARNING, "$version argument ignored");
+ }
+
+ d = curl_version_info(CURLVERSION_NOW);
if (d == NULL) {
RETURN_FALSE;
}
--- /dev/null
+--TEST--
+curl_version(): error conditions
+--SKIPIF--
+<?php
+if (!extension_loaded('curl')) die('skip curl extension not available');
+?>
+--FILE--
+<?php
+curl_version(CURLVERSION_NOW);
+curl_version(0);
+?>
+===DONE===
+--EXPECTF--
+Deprecated: curl_version(): the $version parameter is deprecated in %s on line %d
+
+Warning: curl_version(): $version argument ignored in %s on line %d
+===DONE===