Skip to content

Fix null array offset in _destroy() for PHP 8.5#853

Open
kolotov wants to merge 1 commit intotecnickcom:mainfrom
kolotov:fix/null-file-id-destroy-php85
Open

Fix null array offset in _destroy() for PHP 8.5#853
kolotov wants to merge 1 commit intotecnickcom:mainfrom
kolotov:fix/null-file-id-destroy-php85

Conversation

@kolotov
Copy link

@kolotov kolotov commented Feb 13, 2026

In PHP 8.5, using null as an array offset is deprecated.
The _destroy() method accesses self::$cleaned_ids[$this->file_id]
without checking if $this->file_id is null, triggering a deprecation warning.

Add an early return when $this->file_id is null.

Fixes: #852

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

@williamdes williamdes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this is correct, there is more code that should maybe be executed

@kolotov
Copy link
Author

kolotov commented Feb 13, 2026

You're right. I'll think about it some more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PHP 8.5 deprecation: null array offset in _destroy() when file_id is null

3 participants