]> granicus.if.org Git - php/commitdiff
Remove the deprecated parameter of curl_version()
authorMáté Kocsis <kocsismate@woohoolabs.com>
Thu, 18 Jun 2020 07:26:58 +0000 (09:26 +0200)
committerMáté Kocsis <kocsismate@woohoolabs.com>
Thu, 18 Jun 2020 11:26:32 +0000 (13:26 +0200)
UPGRADING
ext/curl/curl.stub.php
ext/curl/curl_arginfo.h
ext/curl/interface.c
ext/curl/tests/curl_version_error_001.phpt [deleted file]

index b7670f813be9783ba0891c196b5b0abca6733bd5..223abc46a58ac2f54a5700afa9b1fbd50e34a99b 100644 (file)
--- a/UPGRADING
+++ b/UPGRADING
@@ -760,6 +760,7 @@ PHP 8.0 UPGRADE NOTES
     checks for `false`. The curl_share_close() function no longer has an effect,
     instead the CurlShareHandle instance is automatically destroyed if it is no
     longer referenced.
+  . The deprecated parameter `$version` of curl_version() has been removed.
 
 - Enchant:
   . The enchant extension now uses libenchant-2 by default when available.
index f7e20e30f6e2c4b0b808071096d2460e7f436b3a..04edb0f482d8a279dcbfde6005974b24145142f0 100644 (file)
@@ -83,4 +83,4 @@ function curl_share_strerror(int $error_number): ?string {}
 
 function curl_strerror(int $error_number): ?string {}
 
-function curl_version(int $age = UNKNOWN): array|false {}
+function curl_version(): array|false {}
index 72f68a63079bc520d30d1f67c20e9c2a88a1cc93..77956f1ff98bef2b353fe2e8d990d9bb843116af 100644 (file)
@@ -137,7 +137,6 @@ ZEND_END_ARG_INFO()
 #define arginfo_curl_strerror arginfo_curl_multi_strerror
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_curl_version, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE)
-       ZEND_ARG_TYPE_INFO(0, age, IS_LONG, 0)
 ZEND_END_ARG_INFO()
 
 
index bdc284b4abb366259e927a9d6994c09ee0e2931b..7e9cbf2fdffc7906dcfe6b93062d48e3c2ded41b 100644 (file)
@@ -1689,23 +1689,13 @@ static void curl_free_slist(zval *el)
 }
 /* }}} */
 
-/* {{{ proto array curl_version([int version])
+/* {{{ proto array curl_version()
    Return cURL version information. */
 PHP_FUNCTION(curl_version)
 {
        curl_version_info_data *d;
-       zend_long uversion = -1;
 
-       ZEND_PARSE_PARAMETERS_START(0, 1)
-               Z_PARAM_OPTIONAL
-               Z_PARAM_LONG(uversion)
-       ZEND_PARSE_PARAMETERS_END();
-
-       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");
-       }
+       ZEND_PARSE_PARAMETERS_NONE();
 
        d = curl_version_info(CURLVERSION_NOW);
        if (d == NULL) {
diff --git a/ext/curl/tests/curl_version_error_001.phpt b/ext/curl/tests/curl_version_error_001.phpt
deleted file mode 100644 (file)
index c281cc1..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
---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);
-?>
---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