@Findus23 opened this Issue on June 12th 2022 Member

The first alpha of PHP 8.2 has been released and I got a bit of time, so I will be looking into what the major things are that will cause current Matomo to break when using PHP 8.2.
See also #17686 for 8.1

Reading through UPGRADING, I don't see any major breaking changes, but we will see what needs to be changed.

As only the first reported issue here seems to completely brake Matomo and with it fixed, the majority of Matomo is already working fine, I will only list one example per deprecated usage here and link to more information about the deprecation.


Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/lukas/public_html/matomophp8/core/testMinimumPhpVersion.php on line 130

See https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation

https://github.com/matomo-org/matomo/pull/19344 (there are also a few more occurances in tests)


WARNING [2022-06-12 15:26:34] 188990 /home/lukas/public_html/matomophp8/plugins/PrivacyManager/DoNotTrackHeaderChecker.php(29): Deprecated - Creation of dynamic property Piwik\Plugins\PrivacyManager\DoNotTrackHeaderChecker::$config is deprecated - Matomo 4.11.0-rc1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)

I assume this will affect a lot of code, but also it should be really easy to detect with PHPStorm or PHP_CS:
https://wiki.php.net/rfc/deprecate_dynamic_properties
https://php.watch/versions/8.2/dynamic-properties-deprecated
https://github.com/squizlabs/PHP_CodeSniffer/issues/3489

And getting rid of such cases might make the code more readable and especially avoid bugs because of typos.


WARNING [2022-06-12 15:26:35] 188990 /home/lukas/public_html/matomophp8/core/Console.php(135): Deprecated - Callables of the form ["Piwik\Console", "Symfony\Component\Console\Application::doRun"] are deprecated - Matomo 4.11.0-rc1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)
https://github.com/matomo-org/matomo/blob/e3218471244d08039b1b84f1c907f1be0e018768/core/Console.php#L135

https://wiki.php.net/rfc/deprecate_partially_supported_callables
https://php.watch/versions/8.2/partially-supported-callable-deprecation


To be updated...

Powered by GitHub Issue Mirror