In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
So we are putting them under a standard PHP_MAJOR_VERSION < 8 condition.
Also, added TODO comments to remember to delete that block of code when
php80 becomes the minimum required versions in the future (Moodle 4.3?).
When possible, an issue has been created upstream, else a comment in
readme_moodle files has been added.
Finally, when the keys being freed were class or object attributes, also
nullify them (but when the calls were part of destructor methods).