Laravel 5.5 Parse error: syntax error, unexpected '?'

0

Creating a Laravel 5.5 project when opening in the explore my project throws me the following error.

Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_PARSE)
Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE)

I already tried a composer update but the problem persists.

I'm creating the project on ubuntu 16.04 and php 7.1

    
asked by Ricardo Garcia 12.09.2018 в 23:39
source

1 answer

0

Even though you are installing version 5.5 and you meet the requirement PHP >= 7.0 you need to install the project running a version lower than 7.1 since that file is using "nullable" types that are only available from the version 7.1 of PHP. The problem with this seems to be with nesbot/carbon , which uses the PEOOORS dependency versions that I have seen ~ "symfony/translation": "~2.6 || ~3.0 || ~4.0" .

I'm really surprised that the official documentation does not mention any of this, but yes, install version 5.5 within a PHP environment 7.0. *

    
answered by 13.09.2018 в 18:38