Skip to content

Conversation

@TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Oct 20, 2025

Corrects #7128

These functions have no effect on PHP 8.5 (all of them since PHP 8.0/8.1), and can be removed.
Comment with more context: #7128 (comment)

Removing original wrapping rule, as it add unrelated logic to the upgrade path.

@samsonasik
Copy link
Member

samsonasik commented Oct 20, 2025

For note: by this, on downgrade php 8.5 rule, we need downgrade rule to verify add back removed code, then it should add the removed code listed, for example:

$s = curl_exec($curl) ?: $s;
+if (PHP_VERSION_ID < 80500) {
+.    curl_close($curl);
+}

echo "other code unrelated to curl here, above must be closed first with wrap";

because there is no replacement function in php 8.4 and below, and needed.

@TomasVotruba TomasVotruba force-pushed the tv-wrap-func-calls-revisit branch from 750f972 to 8a6c93a Compare October 20, 2025 17:58
@TomasVotruba
Copy link
Member Author

@samsonasik Let's ignore this one, as most likely these functions are not downgraded in the first place.

Also, the RFC (https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_no-op_functions_from_the_resource_to_object_conversion) states it's been without behavior since PHP 8.0/PHP 8.1:

  • finfo_close() since the ext/fileinfo migration in PHP 8.1
  • xml_parser_free() since the ext/xml migration in PHP 8.0
  • curl_close() since the ext/curl migration in PHP 8.0
  • curl_share_close() since the ext/curl migration in PHP 8.0
  • imagedestroy() since the ext/gd migration in PHP 8.0

@TomasVotruba TomasVotruba merged commit 4b30bc5 into main Oct 20, 2025
52 checks passed
@TomasVotruba TomasVotruba deleted the tv-wrap-func-calls-revisit branch October 20, 2025 18:02
@TomasVotruba TomasVotruba changed the title [PHP 8.5] replace WrapFuncCallWithPhpVersionIdCheckerRector with RemoveFuncCallRector removal [PHP 8.5] Replace WrapFuncCallWithPhpVersionIdCheckerRector with RemoveFuncCallRector removal Oct 20, 2025
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.

3 participants