matomo-php-tracker icon indicating copy to clipboard operation
matomo-php-tracker copied to clipboard

PHP 8.2: Creation of dynamic property NNN is deprecated

Open hexa2k9 opened this issue 2 years ago • 2 comments

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

hexa2k9 avatar Dec 14 '22 07:12 hexa2k9

As a workaround you could add #[AllowDynamicProperties] before the class-definition until the problem is solved:

#[AllowDynamicProperties]
class MatomoTracker

Cangoo avatar Jan 16 '23 11:01 Cangoo

@Cangoo Thanks for the hint. I'll add that quickly.

sgiehl avatar Jan 18 '23 14:01 sgiehl

@sgiehl This issue is not actual anymore)

lutdev avatar May 21 '24 16:05 lutdev