Skip to content

[5.4][PHP8.5] Using null as the key parameter for array_key_exists() is deprecated - #46736

Merged
richard67 merged 2 commits into
joomla:5.4-devfrom
heelc29:5.4/php85/plugins/system/languagefilter
Jan 23, 2026
Merged

[5.4][PHP8.5] Using null as the key parameter for array_key_exists() is deprecated#46736
richard67 merged 2 commits into
joomla:5.4-devfrom
heelc29:5.4/php85/plugins/system/languagefilter

Conversation

@heelc29

@heelc29 heelc29 commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

Summary of Changes

Deprecated: Using null as the key parameter for array_key_exists() is deprecated

https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_using_values_null_as_an_array_offset_and_when_calling_array_key_exists

Testing Instructions

  • enable language filter plugin
  • open frontend

After you have applied the PR you have to clean the session (eg. close the browser)

Actual result BEFORE applying this Pull Request

deprecation message (only visible in log file, because redirect)
Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in \plugins\system\languagefilter\src\Extension\LanguageFilter.php

Expected result AFTER applying this Pull Request

no deprecation message

Link to documentations

Please select:

  • No documentation changes for docs.joomla.org needed
  • No documentation changes for manual.joomla.org needed

@Fedik Fedik added the PHP 8.x PHP 8.x deprecated issues label Jan 21, 2026
@Fedik

Fedik commented Jan 21, 2026

Copy link
Copy Markdown
Member

I have tested this item ✅ successfully on b746e24

review


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46736.

@richard67 richard67 added the bug label Jan 21, 2026
@coolcat-creations

Copy link
Copy Markdown
Contributor

I can't reproduce the error before the patch, can you give me an advise? I enabled logging and look into the administrator/logs folder. In none of the files, also not in deprecated is the error you mentioned.

@muhme

muhme commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

I can't reproduce the error before the patch, can you give me an advise? I enabled logging and look into the administrator/logs folder. In none of the files, also not in deprecated is the error you mentioned.

In JBT I can reproduce the problem in using php8.5, enable 'System - Language Filter' plugin and visit the frontend. The deprecated message is in administrator/logs/php.log, but this is the configured log file for the JBT PHP installation. I guess you have to look in your PHP log file, which is usually not inside Joomla.

@brianteeman

Copy link
Copy Markdown
Contributor

I cant replicate the reported error on either j5 or 6

@muhme

muhme commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on b746e24

Tested with JBT using php8.5

  • Deprecated message seen before PR
    [23-Jan-2026 18:13:28 UTC] PHP Deprecated:  Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/plugins/system/languagefilter/src/Extension/LanguageFilter.php on line 922
    
  • Deprecated message is gone after PR
  • ⚠️ There are still other deprecations:
    [23-Jan-2026 18:41:01 UTC] PHP Deprecated:  ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is deprecated, as it allows violating class constraints and invariants in /var/www/html/libraries/vendor/joomla/registry/src/Registry.php on line 256
    [23-Jan-2026 18:41:32 UTC] PHP Deprecated:  Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/src/Menu/AbstractMenu.php on line 164
    

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46736.

@muhme muhme removed PHP 8.x PHP 8.x deprecated issues bug PR-5.4-dev labels Jan 23, 2026
@muhme

muhme commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46736.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jan 23, 2026
@muhme muhme added PHP 8.x PHP 8.x deprecated issues bug PR-5.4-dev labels Jan 23, 2026
@richard67

Copy link
Copy Markdown
Member

I can't reproduce the error before the patch, can you give me an advise? I enabled logging and look into the administrator/logs folder. In none of the files, also not in deprecated is the error you mentioned.

@coolcat-creations It needs PHP error reporting set to maximum and PHP to be configured to log errors into a log file - this can be an extra PHP log or the log file of the webserver (e.g. Apache), depending on the particular environment, and most of all it needs PHP 8.5 for reproducing the issue.

I cant replicate the reported error on either j5 or 6

@brianteeman Did you environment fulfil the above conditions?

@brianteeman

Copy link
Copy Markdown
Contributor

Yes it did and as you know i've regularly worked on deprecated issues and created pull requests in the past. Weird that this one didn't come up but from code review it should have done and this fix is good

@richard67
richard67 merged commit 74c780f into joomla:5.4-dev Jan 23, 2026
69 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jan 23, 2026
@richard67

Copy link
Copy Markdown
Member

@heelc29 Thanks for this PR, and thanks @Fedik and @muhme for review and testing.

@richard67 richard67 added this to the Joomla! 5.4.3 milestone Jan 23, 2026
@exlemor

exlemor commented Jan 24, 2026

Copy link
Copy Markdown

I have tested this item ✅ successfully on ffebc88

I have tested this successfully!

Thanks @heelc29!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46736.

@heelc29
heelc29 deleted the 5.4/php85/plugins/system/languagefilter branch January 28, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug PHP 8.x PHP 8.x deprecated issues PR-5.4-dev

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants