The version in your terminal and the version wamp is using may be different.
In a wamp project create a PHP file and put this in it.
Go to the URL of the PHP file in your browser and that will show you the PHP version the apache server in wamp is using. You can change it using this tutorial.
Changing PHP version in wamp
Good luck!