Per https://github.com/php/php-src/blob/107ad28350e76f40d6e65ceac4e45cbf8cc3dc75/UPGRADING#L138:
. Creation of dynamic properties is deprecated, unless the class opts in by using the #[AllowDynamicProperties] attribute. stdClass allows dynamic properties. Usage of __get()/__set() is not affected by this change. A dynamic properties deprecation warning can be addressed by: - Declaring the property (preferred). - Adding the #[AllowDynamicProperties] attribute to the class (which also applies to all child classes). - Using a WeakMap if you wish to associate additional data with an object you do not own.
Out of the three suggested migration paths, the third one (WeakMap) is not really an option as of now given that WeakMaps were added in PHP 8.