Laravel 5.5 requires PHP 7.0.0 or higher.. are you sure your php version 7 ? in console run php -v and in your routes file put this code and check
Route::get('phpinfo', function(){
phpinfo();
});
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi,
Today I received an error when tried to reset a password using Laravel native controllers...
Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE)
This error is related to the AttributeMatchingExtension class in vendor/symfony/css-selector/XPath/Extension/AttributeMatchingExtension.php file. In that file I found following syntax:
public function translateExists(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr
{
return $xpath->addCondition($attribute);
}
I am working with Laravel 5.5 and PHP 7.0.29, which is good according to the default composer.json, but feature with nullable type declaration like ?string $value appears only in PHP 7.1.
Is it some way to keep Laravel 5.5 running on PHP 7.0.*?
Please or to participate in this conversation.