Skip to content

Drop imagedestroy() calls deprecated in PHP 8.5 - #14

Merged
pjeweb merged 1 commit into
mainfrom
fix/php85-deprecations
Oct 29, 2026
Merged

pjeweb merged 1 commit into
mainfrom
fix/php85-deprecations

Conversation

@pjeweb

@pjeweb pjeweb commented Oct 29, 2026

Copy link
Copy Markdown
Member

imagedestroy() has had no effect since PHP 8.0 and PHP 8.5 deprecates it, so on PHP 8.5 every tile that went through the encode op logged Function imagedestroy() is deprecated since 8.5. The op now releases its GdImage reference with unset(). The tests no longer call imagedestroy(). phpunit.xml sets failOnDeprecation, so the 8.5 CI job fails on the next deprecation. Before this change it passed with "OK, but there were issues".

The rest of the package is clean: php -d error_reporting=E_ALL -l passes on PHP 8.2.35, 8.5.4 and 8.5.12. A grep for the 8.4/8.5 runtime deprecations (curl_close, finfo_close, E_STRICT, $http_response_header, non-canonical casts, …) finds nothing else. In the locked runtime dependencies, Guzzle 7.15.2 only calls curl_close() / curl_share_close() behind PHP_VERSION_ID < 80000 and uses http_get_last_response_headers() when it exists.

Validation: PHPUnit (155 tests, Imagick tests included) and PHPStan pass on PHP 8.2.35 and 8.5.12 with gd and imagick, and on 8.5.4 locally. On 8.5, no deprecations are left.

imagedestroy() has had no effect since PHP 8.0 and PHP 8.5 deprecates it,
so every re-encoded tile logged a deprecation. The encode op now just
releases its reference, the tests no longer call it, and PHPUnit fails on
deprecations so the 8.5 CI job catches the next one.
@pjeweb
pjeweb merged commit 2101fd5 into main Oct 29, 2026
6 checks passed
@pjeweb
pjeweb deleted the fix/php85-deprecations branch October 29, 2026 14:27
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