Search code examples
phplaravellaravel-localization

Laravel - (1/1) FatalErrorException syntax error, unexpected '?' in LaravelLocalization.php line 896


Everything was working well but after doing composer update, I am facing this error

FatalErrorException syntax error, unexpected '?' in LaravelLocalization.php line 896 ",

what is wrong? I'm using mcamara/laravel-localization package


Solution

  • I checked that line inside the code of the package - the error is caused by the ?? operator introduced with PHP7 (http://php.net/manual/en/migration70.new-features.php). It seems you're using an older version of PHP - try switching to version 1.2 of this package.