How to fix PHP Parse error: syntax error, unexpected '?' in vendor\laravel\framework\src\Illuminate\Foundation\helpers.php on line 500

Viewed 8461

Everything is working perfectly but on running I get this error

PHP Parse error: syntax error, unexpected '?' in htdocs\example\vendor\laravel\framework\src\Illuminate\Foundation\helpers.php on line 500

on line 500

return $factory->of($arguments[0], $arguments[1])->times($arguments[2] ?? null);
3 Answers

The ?? operator was introduced in php 7. You should upgrade your php version to the one required by the laravel version you are using.

Just upgrade the php version into PHP 7.1 (ea-php71) on cpanel using MultiPHP Manager .

It seems your php is lower than version 7.1.3, you need to have version above that. try to run phpinfo(). Hope it helps

Related