Description
In PHP 8.5, using null as an array offset is deprecated. The _destroy() method in tcpdf.php accesses self::$cleaned_ids[$this->file_id] without checking if $this->file_id is null first, triggering:
Deprecated: Using null as an array offset is deprecated, use an empty string instead
This happens at line 7891 (self::$cleaned_ids[$this->file_id]).
Steps to reproduce
- Use PHP 8.5
- Generate any PDF — the deprecation warning is triggered in the destructor chain
Suggested fix
Add an early return in _destroy() when $this->file_id is null, before accessing self::$cleaned_ids.
Description
In PHP 8.5, using
nullas an array offset is deprecated. The_destroy()method intcpdf.phpaccessesself::$cleaned_ids[$this->file_id]without checking if$this->file_idis null first, triggering:This happens at line 7891 (
self::$cleaned_ids[$this->file_id]).Steps to reproduce
Suggested fix
Add an early return in
_destroy()when$this->file_idis null, before accessingself::$cleaned_ids.