Skip to content

Fix PHP 8.5 curl_close() deprecation#62

Closed
lohanidamodar wants to merge 1 commit intomainfrom
fix/clo-4290-curl-close-php85
Closed

Fix PHP 8.5 curl_close() deprecation#62
lohanidamodar wants to merge 1 commit intomainfrom
fix/clo-4290-curl-close-php85

Conversation

@lohanidamodar
Copy link
Copy Markdown
Contributor

@lohanidamodar lohanidamodar commented May 3, 2026

Summary

  • Remove the no-op curl_close($ch) call in Analytics\Adapter that triggers a Deprecated notice on PHP 8.5.

Why

curl_close() has been a no-op since PHP 8.0 and is now formally deprecated in 8.5. The curl handle is freed when the variable goes out of scope.

Test plan

  • composer lint (Pint) — pass
  • php -l src/Analytics/Adapter.php — clean

(Note: this repo does not define a composer analyze/PHPStan script; lint is the configured gate.)

curl_close() has been a no-op since PHP 8.0 and is now formally
deprecated in 8.5. The curl handle is freed when the variable goes
out of scope.

Refs: CLO-4290
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 3, 2026

Greptile Summary

Removes the deprecated curl_close($ch) call from Adapter::call() to resolve the PHP 8.5 deprecation notice. The fix is correct — curl_close() has been a no-op since PHP 8.0 and the handle is released when it goes out of scope.

Confidence Score: 5/5

Safe to merge; a one-line removal of a no-op call with a minor style nit about the leftover empty finally block.

Single targeted change with no functional impact; no P0/P1 issues found. One P2 style suggestion to also remove the now-empty finally block.

No files require special attention.

Important Files Changed

Filename Overview
src/Analytics/Adapter.php Removes deprecated curl_close($ch) call from the finally block; leaves an empty finally {} that can also be removed.

Reviews (1): Last reviewed commit: "Remove deprecated curl_close() call (PHP..." | Re-trigger Greptile

Comment thread src/Analytics/Adapter.php
Comment on lines 185 to 188
return $responseBody;
} finally {
curl_close($ch);
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 The finally block is now empty after removing curl_close(). An empty finally block has no effect and can be removed entirely to keep the code clean.

Suggested change
return $responseBody;
} finally {
curl_close($ch);
}
}
return $responseBody;
}
}

@lohanidamodar
Copy link
Copy Markdown
Contributor Author

Superseded by full migration to utopia-php/fetch (raw curl removed entirely, including this curl_close line). Closing in favor of the migration PR opening on a fresh branch.

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.

1 participant