PHP 8.5: Prevent deprecation notices for imagedestroy

`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 commit is contained in:
Tobias Bäthge
2025-09-01 16:50:53 +02:00
committed by GitHub
parent ff7195c274
commit 9baabd2a0b
@@ -65,7 +65,9 @@ class MemoryDrawing extends BaseDrawing
public function __destruct()
{
if ($this->imageResource) {
@imagedestroy($this->imageResource);
if (\PHP_VERSION_ID < 80000) {
@imagedestroy($this->imageResource);
}
$this->imageResource = null;
}
$this->worksheet = null;