Issue to collect PHP 8.4 deprecation messages and fixes
Transitive dependencies:
Labels |
Added:
No Code Attached Yet
|
Labels |
Added:
PHP 8.x
|
Labels |
Added:
bug
|
strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in \administrator\components\com_users\src\Model\CaptiveModel.php
on line 429
PR #45169
Only the first byte will be assigned to the string offset in administrator\components\com_users\src\Model\BackupcodesModel.php
on line 258
PR #45170
I believe all the php 8.4 issues have now been resolved with 5.3
I think laminas-diactoros is still missing, not sure if it's still relevant.
Hello,
I'm experiencing a recurring issue during Joomla! upgrades that seems related to deprecated PHP functions, though it specifically involves utf8_decode, which was deprecated in PHP 8.2 (not 8.4).
Problem Description:
Every time I upgrade Joomla! from 5.2.x to 5.3.x, the file joomla/string/src/phputf8/native/core.php reverts to using the deprecated utf8_decode function within utf8_strlen.
Specific Location and Code:
The problematic line is around Line 204 in joomla/string/src/phputf8/native/core.php.
Before my fix:
function utf8_strlen($str)
{
return strlen(utf8_decode($str));
}
$strlen = strlen(utf8_decode($str));
After my manual fix:
function utf8_strlen($str)
{
return mb_strlen($str, 'UTF-8');
}
$strlen = mb_strlen($str, 'UTF-8');
Environment:
Joomla! Version: Upgrading from 5.2.x (e.g., 5.2.3) to 5.3.x (e.g., 5.3.0)
PHP Version: PHP 8.3.6 (though the issue is with PHP 8.2 deprecation)
This manual correction is required after every upgrade, which is a bit cumbersome. I noticed that voku/portable-utf8 was mentioned in this issue, and since this file (core.php) is related to UTF-8 handling, I thought it might be relevant here.
Could you please confirm if this is a known bug or if there's an ongoing fix for this specific utf8_decode usage?
Thank you for your time and assistance.
spotted two deprecation notices in my logs after running cypress tests on 5.4.
Created fixes
joomla-backports/json-api-php#4
#45778
Hi everyone,
After further investigation, I found that the issue is not in the Joomla CMS core, but in a separate dependency, joomla-framework/string.
I have opened an issue directly in that project's GitHub repository. You can follow the progress here:
I hope this helps to clarify the situation and will lead to a fix soon.
Thank you for your support.
Hi everyone,
I'm reporting back on this issue.
The core problem was not with the CMS, but with my PHP configuration. As pointed out by the joomla-framework/string team, the mbstring extension was not enabled in my php.ini file.
After enabling mbstring and restarting my web server, the deprecation warning is now gone.
Thank you all for your support and guidance. This thread can be closed now.
Best regards,
dangerouswoo
I think laminas-diactoros is still missing, not sure if it's still relevant.
@HLeithner why not 3.x for laminas-diactoros? As far as I found we use it only 3 times, for accessing php://memory
, like
joomla-cms/libraries/src/Http/Transport/CurlTransport.php
Lines 261 to 262 in 37612d3
I think laminas-diactoros is still missing, not sure if it's still relevant.
@HLeithner why not 3.x for laminas-diactoros? As far as I found we use it only 3 times, for accessing
php://memory
, likejoomla-cms/libraries/src/Http/Transport/CurlTransport.php
Lines 261 to 262 in 37612d3
$streamInterface = new StreamResponse('php://memory', 'rw');
$streamInterface->write($body);
of course should be done, this list was for joomla 5.3 where a major update of a dependency might not be possible.
For Joomla 6 this is already solved since in the composer.json ^3.6 is requried
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-08-17 09:18:26 |
Closed_By | ⇒ | HLeithner |
I'm closing this because I think all of them are fixed.
The currently installed Joomla! version is "5.2.2", with Php 8.4
"PHP message: PHP Deprecated: Function lcg_value() is deprecated since 8.4, use \Random\Randomizer::getFloat() instead in /joomla/plugins/system/sessiongc/src/Extension/SessionGC.php on line 66"
PHP message: PHP Deprecated: Tuf\Client\Repository::getSnapshot(): Implicitly marking parameter $maxBytes as nullable is deprecated, the explicit nullable type must be used instead in /joomla/libraries/vendor/php-tuf/php-tuf/src/Client/Repository.php
PHP message: PHP Deprecated: GuzzleHttp\Promise\FulfilledPromise::then(): Implicitly marking parameter $onRejected as nullable is deprecated, the explicit nullable type must be used instead in /joomla/libraries/vendor/guzzlehttp/promises/src/FulfilledPromise.php on line 26
PHP message: PHP Deprecated: GuzzleHttp\Promise\PromiseInterface::then(): Implicitly marking parameter $onFulfilled as nullable is deprecated, the explicit nullable type must be used instead in /joomla/libraries/vendor/guzzlehttp/promises/src/PromiseInterface.php on line 29
PHP message: PHP Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in /joomla/libraries/src/Updater/Update.php on line 660; PHP message: PHP Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in /joomla/libraries/src/Updater/Update.php on line 661; PHP message: PHP Deprecated: xml_set_character_data_handler(): Passing non-callable strings is deprecated since 8.4 in /joomla/libraries/src/Updater/Update.php on line 662
PHP Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in /joomla/libraries/src/Updater/Adapter/ExtensionAdapter.php on line 284; PHP message: PHP Deprecated: xml_set_character_data_handler(): Passing non-callable strings is deprecated since 8.4 in /joomla/libraries/src/Updater/Adapter/ExtensionAdapter.php on line 285; PHP message: PHP Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in /joomla/libraries/src/Updater/Adapter/ExtensionAdapter.php on line 283;