You're not running Moodle 4.2.2. You've upgraded PHP, but not Moodle. Here's (a link) to the error line in 4.2.2
https://github.com/moodle/moodle/blob/91e6642f16492fd8a6443e1581e1b14592f74e44/lib/dml/mysqli_native_moodle_recordset.php#L82
...it's just an empty line. Couldn't have caused the error
Here's the same line in 4.0.5
https://github.com/moodle/moodle/blob/fdbcfa1b153ee8b3cf863044f7b28f8b3b7a9500/lib/dml/mysqli_native_moodle_recordset.php#L82
...function declaration which definitely could have caused the error.
https://github.com/moodle/moodle/blob/91e6642f16492fd8a6443e1581e1b14592f74e44/lib/dml/mysqli_native_moodle_recordset.php#L82
...it's just an empty line. Couldn't have caused the error
Here's the same line in 4.0.5
https://github.com/moodle/moodle/blob/fdbcfa1b153ee8b3cf863044f7b28f8b3b7a9500/lib/dml/mysqli_native_moodle_recordset.php#L82
...function declaration which definitely could have caused the error.
