-1

I'm practicing coding using Laravel 9 (for the first time) and reinstalling it. However, running it through cmd or Terminal throws an error saying the following.

Syntax error: unexpected token '?' PHP(PHP2014) in the folder vender/symfony/http-kernel/Attribule/MapDataTime.php.

Screenshot

Syntax error: unexpected token 'Requirement' PHP(PHP2014)] The other will be in vender/symfony/routing/Requirement/Requirement.php

Screenshot

I'm looking for a solution.

Karl Hill
  • 12,937
  • 5
  • 58
  • 95
Gak kitkat
  • 11
  • 1
  • 1
  • what is the version of your PHP ? – xenooooo Nov 26 '22 at 06:47
  • To copy text from your editor, you can highlight it with the mouse and hit Ctrl+C. You can then paste it into your Stack Overflow question with Ctrl+V and format it as source code with the `{}` (Code Sample) toolbar button. – Álvaro González Nov 28 '22 at 09:57

1 Answers1

2

You're using PHP 8.0 (according to the PHP version in your IDE screenshot).

ENUMs were introduced in PHP 8.1.

See here if you need help changing the PHP version (I'm assuming you're using Visual Studio Code, based on your screenshots) - how to change the version of php in vscode?

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
Dan.
  • 609
  • 1
  • 6
  • 17