Symfony命令行解析错误

Good afternoon,

I'm working on a symfony project and everything was going well until I received the following messages :

PHP Warning: Unsupported declare 'strict_types' in .../vendor/ocramius/proxy-manager/src/ProxyManager/Configuration.php on line 19

PHP Parse error: parse error, expecting ';'' or'{'' in .../vendor/ocramius/proxy-manager/src/ProxyManager/Configuration.php on line 97

These 2 messages appear whenever I try to use the command line in symfony.

I tried the following commands:

php app/console generate:doctrine:entity 

and

php app/console cache:clear --env=prod.

I also tried to use php bin/console instead of app/console as I'm aware the new symfony versions use php bin/console.

I'm using Mamp with php version 7.1 and Symfony version 2.8 for the projects.

Thanks for your help!

If someone runs into this issue it means that your php version is not 7.0 The issue I had was that the Mamp version was 7.1.1 and the symfony project was also running on 7.1.1 in the browser but when I checked the php version in the bash commands, it was 5.6 so make sure you're bash commands use php 7.0 instead of 5.6