Skip to content

Conversation

@mjansenDatabay
Copy link
Contributor

This function has no effect.
Prior to PHP 8.0.0, this function was used to
close the resource.

This function has no effect.
Prior to PHP 8.0.0, this function was used to
close the resource.
@mjansenDatabay mjansenDatabay added improvement php Pull requests that update Php code labels Jan 26, 2026
Copy link
Member

@chfsx chfsx left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

Copy link
Contributor

@GitHamo GitHamo left a comment

Choose a reason for hiding this comment

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

Thanks for the effort on this but I don't think we should remove it. While curl_close() is deprecated in PHP 8.5, it does not trigger warnings in earlier versions and still explicitly releases the cURL handle. PHP will clean it up at shutdown, but keeping it remains best practice and helps avoid issues in long-running contexts.

@mjansenDatabay What do you think?

@mjansenDatabay
Copy link
Contributor Author

mjansenDatabay commented Jan 26, 2026

Hi @GitHamo ,

if we decide to support PHP 8.5 with ILIAS 12, we MUST remove this. Several years ago we as community agreed on a Zero Deprecation Policy, which means ILIAS has to work with error_reporting(-1); (at least in DEVMODE), and all E_DEPRECATED issues MUST be fixed.

According to the official PHP documentation, calling curl_close has NO effect when using PHP >= 8.0.

If we see a need to free resources manually (which did not work the last years), we could execute $this->ch = null; or unset($ch); / $ch = null.
I am not convinced we should do/need this (in most of our scenarios).

Best regards,
Michael

Copy link
Contributor

@GitHamo GitHamo left a comment

Choose a reason for hiding this comment

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

@mjansenDatabay Other than my previous comment, the changes looks good to me. Thank you for the clarification (specially about the Zero Deprecation Policy) and the PR effort 👍

Copy link
Contributor

@sKarki999 sKarki999 left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thank you @mjansenDatabay for the information and the effort :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants