mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-16 13:06:31 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user