Environment
- PHP 8.5
FieldtypeQRCode.module
- GIF QR-code output (
generateRawQRCode($text, false, ...))
Problem
Generating a GIF QR code emits:
PHP Deprecated: Function imagedestroy() is deprecated since 8.5, as it has no effect since PHP 8.0
The call is currently made after imagegif($im) in FieldtypeQRCode::generateRawQRCode().
Suggested change
Only call imagedestroy() on PHP versions older than 8.0, or remove the call if PHP 8+ is the minimum supported version:
imagegif($im);
if (PHP_VERSION_ID < 80000) {
imagedestroy($im);
}
GD objects are released automatically on PHP 8+, so this preserves compatibility with older PHP versions while avoiding the PHP 8.5 deprecation.
Environment
FieldtypeQRCode.modulegenerateRawQRCode($text, false, ...))Problem
Generating a GIF QR code emits:
The call is currently made after
imagegif($im)inFieldtypeQRCode::generateRawQRCode().Suggested change
Only call
imagedestroy()on PHP versions older than 8.0, or remove the call if PHP 8+ is the minimum supported version:GD objects are released automatically on PHP 8+, so this preserves compatibility with older PHP versions while avoiding the PHP 8.5 deprecation.