No Code Attached Yet PHP 8.x bug
avatar HLeithner
HLeithner
21 Nov 2024

Issue to collect PHP 8.4 deprecation messages and fixes

Transitive dependencies:

  • GuzzleHttp\Promise - Might be fixed after update in 5.4 and 6.0 to 2.2.0?
avatar HLeithner HLeithner - open - 21 Nov 2024
avatar joomla-cms-bot joomla-cms-bot - change - 21 Nov 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 Nov 2024
avatar HLeithner HLeithner - change - 21 Nov 2024
The description was changed
avatar HLeithner HLeithner - edited - 21 Nov 2024
avatar HLeithner HLeithner - change - 21 Nov 2024
The description was changed
avatar HLeithner HLeithner - edited - 21 Nov 2024
avatar HLeithner HLeithner - change - 21 Nov 2024
The description was changed
avatar HLeithner HLeithner - edited - 21 Nov 2024
avatar Fedik Fedik - change - 21 Nov 2024
Labels Added: PHP 8.x
avatar Fedik Fedik - labeled - 21 Nov 2024
avatar Hackwar Hackwar - change - 23 Nov 2024
Labels Added: bug
avatar Hackwar Hackwar - labeled - 23 Nov 2024
avatar HLeithner HLeithner - change - 10 Dec 2024
The description was changed
avatar HLeithner HLeithner - edited - 10 Dec 2024
avatar t0mtaylor
t0mtaylor - comment - 30 Dec 2024

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;

avatar brianteeman
brianteeman - comment - 19 Mar 2025

PHP Deprecated:

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

PHP Warning:

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

avatar laoneo laoneo - change - 20 Mar 2025
The description was changed
avatar laoneo laoneo - edited - 20 Mar 2025
avatar laoneo laoneo - change - 20 Mar 2025
The description was changed
avatar laoneo laoneo - edited - 20 Mar 2025
avatar laoneo laoneo - change - 20 Mar 2025
The description was changed
avatar laoneo laoneo - edited - 20 Mar 2025
avatar laoneo laoneo - change - 20 Mar 2025
The description was changed
avatar laoneo laoneo - edited - 20 Mar 2025
avatar brianteeman
brianteeman - comment - 26 Mar 2025

I believe all the php 8.4 issues have now been resolved with 5.3

avatar HLeithner
HLeithner - comment - 26 Mar 2025

I think laminas-diactoros is still missing, not sure if it's still relevant.

avatar T-Nosaka
T-Nosaka - comment - 13 Jul 2025

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.

avatar brianteeman
brianteeman - comment - 25 Jul 2025

spotted two deprecation notices in my logs after running cypress tests on 5.4.
Created fixes
joomla-backports/json-api-php#4
#45778

avatar T-Nosaka
T-Nosaka - comment - 17 Aug 2025

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:

[Issue URL]

I hope this helps to clarify the situation and will lead to a fix soon.

Thank you for your support.

avatar T-Nosaka
T-Nosaka - comment - 17 Aug 2025

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

avatar Fedik
Fedik - comment - 17 Aug 2025

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

$streamInterface = new StreamResponse('php://memory', 'rw');
$streamInterface->write($body);

avatar HLeithner
HLeithner - comment - 17 Aug 2025

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

$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

avatar HLeithner HLeithner - change - 17 Aug 2025
The description was changed
avatar HLeithner HLeithner - edited - 17 Aug 2025
avatar HLeithner HLeithner - change - 17 Aug 2025
The description was changed
avatar HLeithner HLeithner - edited - 17 Aug 2025
avatar HLeithner HLeithner - change - 17 Aug 2025
The description was changed
avatar HLeithner HLeithner - edited - 17 Aug 2025
avatar HLeithner HLeithner - change - 17 Aug 2025
Status New Closed
Closed_Date 0000-00-00 00:00:00 2025-08-17 09:18:26
Closed_By HLeithner
avatar HLeithner HLeithner - close - 17 Aug 2025
avatar HLeithner
HLeithner - comment - 17 Aug 2025

I'm closing this because I think all of them are fixed.

Add a Comment

Login with GitHub to post a comment