Laravel 5 : Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE)

TrueCode picture TrueCode · Feb 14, 2018 · Viewed 33.5k times · Source

On my Local server everything was good was using mailtrap mail server as smtp server. but when my website is on live server and when I trying to reset password (forgot password ) getting following error screenshot is attached.I am using hostgators cpanels inbuilt smtp. any more details I will provide if needed.enter image description here

Answer

Alexey Mezenin picture Alexey Mezenin · Feb 14, 2018

You need to install PHP version 7.1 because nullable types were introduced in 7.1:

?string $value

And from the Laravel docs:

You will need to make sure your server meets the following requirements:

PHP >= 7.1.3