diff --git a/lib/dmllib.php b/lib/dmllib.php index e2f6b3c05d7..e0621b2c9a7 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -2328,7 +2328,10 @@ function rcache_set($table, $id, $rec) { $rcache->data[$table] = array(); } if (!isset($rcache->data[$table][$id]) and count($rcache->data[$table]) > $CFG->intcachemax) { - array_shift($rcache->data[$table]); + // release oldes record + reset($rcache->data[$table]); + $key = key($rcache->data[$table]); + unset($rcache->data[$table][$key]); } $rcache->data[$table][$id] = clone($rec); } else {