Skip to content

Commit

Permalink
ext/curl: deprecate CURLOPT_BINARYTRANSFER
Browse files Browse the repository at this point in the history
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 phpGH-13114.
  • Loading branch information
divinity76 authored and devnexen committed Jan 10, 2024
1 parent 52cc17c commit fc16285
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions ext/curl/curl.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions ext/curl/curl_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion ext/curl/tests/bug46711.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fc16285

Please sign in to comment.