Hafiz Mohsin Barkati
Hafiz Mohsin Barkati

Reputation: 31

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

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);

Upvotes: 3

Views: 9581

Answers (3)

rashedcs
rashedcs

Reputation: 3725

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

Upvotes: 2

afikri
afikri

Reputation: 394

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

Upvotes: 0

Jack Robertson
Jack Robertson

Reputation: 383

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

Upvotes: 5

Related Questions