Upgrade 8.2.1 -> 8.2.2 PHP Parse error: syntax error, unexpected 'class' (T_CLASS)

Does your file match this one, character by character?

As far as I can research, there are only two ways you can be seeing this error:

  • an old PHP version for some reason getting invoked
  • some syntactic problem a bit above the error line

EDIT: one more possibility!

  • some trouble inside the required file which precedes this line (require dirname(__DIR__) . '/vendor/autoload.php';)