laravel“解析错误:语法错误,意外的'const'(T_CONST),需要变量(T_VARIABLE)”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/49930059/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
laravel "Parse error: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE)"
提问by sepehr
i moved my laravel project from local to sharedhost but the laravel give this error :
我将我的 Laravel 项目从本地移动到共享主机,但 Laravel 出现此错误:
"Parse error: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE)"
in
在
public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php
host php version : 7.0
主机 php 版本:7.0
采纳答案by Douwe de Haan
That code only works from PHP 7.1 and up.
该代码仅适用于 PHP 7.1 及更高版本。
Note:
As of PHP 7.1.0 visibility modifiers are allowed for class constants.
笔记:
自 PHP 7.1.0 起,类常量允许使用可见性修饰符。
Upgrade your PHP version or use an earlier version of Doctrine's DBal.
升级您的 PHP 版本或使用较早版本的 Doctrine 的 DBal。