Skip to content

Fix: Resolve curl_close deprecation warning on php 8.5#100

Merged
glensc merged 1 commit into
perftools:mainfrom
glensc:php-8.5-curl
May 11, 2026
Merged

Fix: Resolve curl_close deprecation warning on php 8.5#100
glensc merged 1 commit into
perftools:mainfrom
glensc:php-8.5-curl

Conversation

@glensc
Copy link
Copy Markdown
Contributor

@glensc glensc commented May 11, 2026

Pull request overview

This PR updates the UploadSaver cURL submission logic to avoid triggering the curl_close() deprecation warning introduced in PHP 8.5 (where curl_close() has been a no-op since PHP 8.0).

Changes:

  • Make curl_close($ch) conditional on PHP_VERSION_ID < 80000 to avoid PHP 8.5 deprecation warnings.

> Deprecated: Function curl_close() is deprecated since 8.5,
> as it has no effect since PHP 8.0
@glensc glensc self-assigned this May 11, 2026
@glensc glensc requested a review from Copilot May 11, 2026 20:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the UploadSaver cURL submission logic to avoid triggering the curl_close() deprecation warning introduced in PHP 8.5 (where curl_close() has been a no-op since PHP 8.0).

Changes:

  • Make curl_close($ch) conditional on PHP_VERSION_ID < 80000 to avoid PHP 8.5 deprecation warnings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Saver/UploadSaver.php
Comment on lines 77 to +85
$result = curl_exec($ch);
if ($result === false) {
$error = curl_errno($ch) ? curl_error($ch) : '';
throw new ProfilerException('Failed to submit data' . ($error ? ': ' . $error : ''));
}
curl_close($ch);

if (PHP_VERSION_ID < 80000) {
curl_close($ch);
}
Comment thread src/Saver/UploadSaver.php
Comment on lines +83 to +85
if (PHP_VERSION_ID < 80000) {
curl_close($ch);
}
@glensc glensc merged commit d5bedbf into perftools:main May 11, 2026
13 checks passed
@glensc glensc deleted the php-8.5-curl branch May 11, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants