Repository navigation
Conversation
curl_close() has been a no-op since PHP 8.0 and PHP 8.5 deprecates it. On hosts with display_errors on, the notice is printed into every proxied JSON response. With output buffering off, the early output also makes http_response_code() fail with "headers already sent", so backend error statuses reach the browser as 200. api.php now calls curl_close() only below PHP 8.0, where it still frees the handle. The smoke runs php -S with every error class displayed and output buffering off, checks that each reply parses as JSON, and covers status forwarding plus the upload, download and stream helpers. CI runs it on PHP 7.4 and 8.5.
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
curl_close()has been a no-op since PHP 8.0, and PHP 8.5 deprecates it. On hosts withdisplay_errorson, the deprecation notice ends up in every JSON response thatapi.phpproxies. If output buffering is also off, that early output makeshttp_response_code()fail with "headers already sent", so backend error statuses reach the browser as 200. For example, a 404 for a dead session arrives as a 200.api.php: a newrelease_curl()helper callscurl_close()only below PHP 8.0, where it still frees the handle. It replaces all 7 call sites.tests/php/smoke.sh:php -Swithdisplay_errors=1,error_reporting=-1andoutput_buffering=0, so notices and lost statuses can't be hidden by the runner's ini.Test plan
api.php: the deprecation notice shows up in the body, and 404 becomes 200.