-
Bug
-
Resolution: Fixed
-
Minor
-
3.8, 3.9
-
MOODLE_38_STABLE, MOODLE_39_STABLE
-
MOODLE_38_STABLE
-
From PHP 7.4 upgrading info:
The "creating default object from empty value" warning is now consistently
thrown if a falsy value is promoted into an stdClass object. Previously some
cases like `$null->prop[0] = $val` missed this warning.
Main problem with this issue is that it's impossible to detect all cases programmatically and we only can fix them while they happen (right now, with phpunit and behat executions).
So, hoping that coverage will unveil the majority of them and knowing that this change doesn't lead to any fatal error (but "just" warnings) that's the approach we are going to follow:
- Impossible to detect in advance.
- Fix all uses found via automated testing.
- Remaining cases will be fixed when discovered (if any).