I'm guessing you upgraded PHP? However, you shouldn't get that error with either 3.4 or 3.5. That would be Moodle 3.3 or older. Are you *sure* you have Moodle 3.4?
That line in 3.3
https://github.com/moodle/moodle/blob/MOODLE_33_STABLE/lib/setuplib.php#L66
Then in 3.4
https://github.com/moodle/moodle/blob/MOODLE_34_STABLE/lib/setuplib.php#L65
It's not even the same line. So, I'm pretty sure you're not upgrading from 3.4