1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

ext/curl: deprecate CURLOPT_BINARYTRANSFER

This is long overdue, CURLOPT_BINARYTRANSFER has been a no-op since PHP5.1.2 in 2004 (ref https://bugs.php.net/bug.php?id=55635 )

Close GH-13114.
This commit is contained in:
hanshenrik
2024-01-10 10:41:24 +01:00
committed by David Carlier
parent 52cc17c665
commit fc16285538
5 changed files with 11 additions and 3 deletions

3
NEWS
View File

@@ -8,6 +8,9 @@ Core:
. Enabled ifunc checks on FreeBSD from the 12.x releases. (Freaky)
. Changed the type of PHP_DEBUG and PHP_ZTS constants to bool. (haszi)
Curl:
. Deprecated the CURLOPT_BINARYTRANSFER constant. (divinity76)
Date:
. Added DateTime[Immutable]::createFromTimestamp. (Marc Bennewitz)

View File

@@ -177,6 +177,9 @@ PHP 8.4 UPGRADE NOTES
4. Deprecated Functionality
========================================
- Curl:
. The CURLOPT_BINARYTRANSFER constant is deprecated.
- Date:
. Calling DatePeriod::__construct(string $isostr, int $options = 0) is
deprecated. Use DatePeriod::createFromISO8601String() instead.

View File

@@ -13,6 +13,7 @@
const CURLOPT_AUTOREFERER = UNKNOWN;
/**
* @var int
* @deprecated has no effect since 5.1.2
* @cvalue CURLOPT_BINARYTRANSFER
*/
const CURLOPT_BINARYTRANSFER = UNKNOWN;

View File

@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: d524d2fd58e484682c860d8a72eafc9a7d544911 */
* Stub hash: aebc4c2673203a4af49f55dd6eaf0bdbb4cafd68 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_close, 0, 1, IS_VOID, 0)
ZEND_ARG_OBJ_INFO(0, handle, CurlHandle, 0)
@@ -233,7 +233,7 @@ static const zend_function_entry class_CurlShareHandle_methods[] = {
static void register_curl_symbols(int module_number)
{
REGISTER_LONG_CONSTANT("CURLOPT_AUTOREFERER", CURLOPT_AUTOREFERER, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CURLOPT_BINARYTRANSFER", CURLOPT_BINARYTRANSFER, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CURLOPT_BINARYTRANSFER", CURLOPT_BINARYTRANSFER, CONST_PERSISTENT | CONST_DEPRECATED);
REGISTER_LONG_CONSTANT("CURLOPT_BUFFERSIZE", CURLOPT_BUFFERSIZE, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CURLOPT_CAINFO", CURLOPT_CAINFO, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CURLOPT_CAPATH", CURLOPT_CAPATH, CONST_PERSISTENT);

View File

@@ -20,7 +20,8 @@ foreach( $opt as $option => $value ) {
var_dump($opt); // with this bug, $opt[58] becomes NULL
?>
--EXPECT--
--EXPECTF--
Deprecated: Constant CURLOPT_BINARYTRANSFER is deprecated in %s on line %d
array(2) {
[58]=>
bool(true)