matomo-php-tracker
matomo-php-tracker copied to clipboard
PHP 8.2: Creation of dynamic property NNN is deprecated
I'm using MatomoTracker in a PHP application running on various PHP Versions (7.4, 8.0, 8.1, 8.2). While most of the versions are running just fine on PHP 8.2 I see a lot of deprecation Messages when using the Tracker:
PHP Deprecated: Creation of dynamic property MatomoTracker::$ecommerceItems is deprecated in APPLICATION/vendor/matomo/matomo-php-tracker/MatomoTracker.php on line 85
PHP Deprecated: Creation of dynamic property MatomoTracker::$attributionInfo is deprecated in APPLICATION/vendor/matomo/matomo-php-tracker/MatomoTracker.php on line 86
PHP Deprecated: Creation of dynamic property MatomoTracker::$eventCustomVar is deprecated in APPLICATION/vendor/matomo/matomo-php-tracker/MatomoTracker.php on line 87
PHP Deprecated: Creation of dynamic property MatomoTracker::$forcedDatetime is deprecated in APPLICATION/vendor/matomo/matomo-php-tracker/MatomoTracker.php on line 88
PHP Deprecated: Creation of dynamic property MatomoTracker::$forcedNewVisit is deprecated in APPLICATION/vendor/matomo/matomo-php-tracker/MatomoTracker.php on line 89
PHP Deprecated: Creation of dynamic property MatomoTracker::$networkTime is deprecated in APPLICATION/vendor/matomo/matomo-php-tracker/MatomoTracker.php on line 90
PHP Deprecated: Creation of dynamic property MatomoTracker::$serverTime is deprecated in APPLICATION/vendor/matomo/matomo-php-tracker/MatomoTracker.php on line 91
As a workaround you could add #[AllowDynamicProperties] before the class-definition until the problem is solved:
#[AllowDynamicProperties]
class MatomoTracker
@Cangoo Thanks for the hint. I'll add that quickly.
@sgiehl This issue is not actual anymore)