MDL-73420 core: make static cache compatible with PHP8.1

This commit is contained in:
Marina Glancy
2021-12-20 17:07:05 +01:00
parent 58a729f088
commit 24db1f29fe
+5 -4
View File
@@ -274,12 +274,13 @@ abstract class persistent {
final public static function properties_definition() {
global $CFG;
static $def = null;
if ($def !== null) {
return $def;
static $cachedef = [];
if (isset($cachedef[static::class])) {
return $cachedef[static::class];
}
$def = static::define_properties();
$cachedef[static::class] = static::define_properties();
$def = &$cachedef[static::class];
$def['id'] = array(
'default' => 0,
'type' => PARAM_INT,