Skip to content

Conversation

@TobiasBg
Copy link
Contributor

@TobiasBg TobiasBg commented Sep 1, 2025

imagedestroy is deprecated in PHP 8.5+, and hasn't been doing anything since PHP 8.0.

To prevent deprecation warnings it should therefore be called on older versions of PHP only.

See https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_no-op_functions_from_the_resource_to_object_conversion.

This is:

  • a bugfix
  • a new feature
  • refactoring
  • additional unit tests

Checklist:

  • Changes are covered by unit tests
    • Changes are covered by existing unit tests
    • New unit tests have been added
  • Code style is respected
  • Commit message explains why the change is made (see https://github.com/erlang/otp/wiki/Writing-good-commit-messages)
  • CHANGELOG.md contains a short summary of the change and a link to the pull request if applicable
  • Documentation is updated as necessary

`imagedestroy` is deprecated in PHP 8.5+, and hasn't been doing anything since PHP 8.0.

To prevent deprecation warnings it should therefore be called on older versions of PHP only.

See https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_no-op_functions_from_the_resource_to_object_conversion.
@oleibman
Copy link
Collaborator

oleibman commented Sep 1, 2025

Thank you for identifying this problem. We do not support any Php release below 8.1, so you can just delete the imagedestroy statement. This will satisfy both phpstan and (probably) coveralls. Please make that change and I will move this forward.

Copy link
Contributor Author

@TobiasBg TobiasBg left a comment

Choose a reason for hiding this comment

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

Ah, yes, of course! Then the imagedestroy call can be removed entirely.

@oleibman
Copy link
Collaborator

oleibman commented Sep 1, 2025

Sorry, I wasn't sure if you were around today, so I made that change myself. I was really curious to see how Coveralls handled the change. It did well. I deleted 2 statements, which actually resulted in reduced coverage - previous was 74/102 = 72.5%, new is 72/100 = 72%. This will just happen sometimes, and Coverall reported success.

@oleibman oleibman added this pull request to the merge queue Sep 1, 2025
@oleibman
Copy link
Collaborator

oleibman commented Sep 1, 2025

Thank you for your contribution.

Merged via the queue into PHPOffice:master with commit fb51c3d Sep 1, 2025
14 checks passed
@TobiasBg
Copy link
Contributor Author

TobiasBg commented Sep 1, 2025

No worries! I assume it's even faster for you to just make these small changes than working of PRs sometimes :-)

Good to hear that this is helpful!

@TobiasBg TobiasBg deleted the patch-1 branch September 1, 2025 18:26
TobiasBg added a commit to TablePress/PhpSpreadsheet that referenced this pull request Sep 4, 2025
…ving this function call entirely is not desired.

To prevent deprecation warnings, it's called conditionally.

Revert "Merge pull request PHPOffice#4625 from TobiasBg/patch-1"

This reverts commit fb51c3d, reversing
changes made to ff7195c.
TobiasBg added a commit to TablePress/PhpSpreadsheet that referenced this pull request Sep 8, 2025
…ving this function call entirely is not desired.

To prevent deprecation warnings, it's called conditionally.

Revert "Merge pull request PHPOffice#4625 from TobiasBg/patch-1"

This reverts commit fb51c3d, reversing
changes made to ff7195c.
TobiasBg added a commit to TablePress/PhpSpreadsheet that referenced this pull request Oct 27, 2025
…ving this function call entirely is not desired.

To prevent deprecation warnings, it's called conditionally.

Revert "Merge pull request PHPOffice#4625 from TobiasBg/patch-1"

This reverts commit fb51c3d, reversing
changes made to ff7195c.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants