If you look here:
You will see that PHP 7.0.x and 7.1.x can be used with caution. Nobody mentions PHP 7.2.x which is what you have.
In PHP 7.2 it is strictly prohibited to declare classes that have reserved names. Moodle up until 3.4 does have instances of this.
- Downgrade the PHP to 7.1x or older. if you do choose PHP 7.1x make sure it is 7.1.13 or more recent because of another issue: https://help.nextcloud.com/t/php-error-narrowing-occurred-during-type-inference/24010/15
- Another option is to use Moodle 3.4 which does support PHP 7.2