MDL-52438 core: allow Moodle 3.0 to be used with PHP7