Uh oh!
There was an error while loading. Please reload this page.
[RFC] Deprecate imagedestroy() - #19454
Conversation
DanielEScherzer
commented
Aug 11, 2025
To avoid merge conflicts, NEWS/UPGRADING will be sent once this is approved |
| /** @param resource|string|null $file */ | ||
| function imagebmp(GdImage $image, $file = null, bool $compressed = true): bool {} | ||
| #[\Deprecated(since: '8.5', message: "as it has no effect since PHP 8.0")] |
There was a problem hiding this comment.
Didn't notice in the RFC, but the consistent wording with the existing functions would be:
| #[\Deprecated(since: '8.5', message: "as it has no effect since PHP 8.0")] | |
| #[\Deprecated(since: '8.5', message: "as GdImage objects are freed automatically")] |
There was a problem hiding this comment.
since we proposed the wording on the RFC, I'd prefer to start with using that message and then we can tweak it in a separate patch if desired; same for the other patches for the no-op deprecations
There was a problem hiding this comment.
Okay with me (that's why I opted just to comment rather than “Request Changes”).
| $c = imagecolorat($im, 191,35); | ||
| imagegif($im, $dest); | ||
| imagedestroy($im); | ||
| $im = null; |
There was a problem hiding this comment.
| $im = null; | |
| unset($im); |
I have a feeling that unset() would capture the intent a little better, but no strong opinion.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_imagedestroy