当我使用 Composer 安装 Laravel 5 时,出现此错误:
Cannot use 'PhpParser\Node\Scalar\String' as class name as it is reserved in /Applications/XAMPP/xamppfiles/htdocs/learnlaravel5/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php on line 86
Image of the error here
怎么了?
最佳答案
我假设您使用的是 PHP7,否则您不会收到此错误 (?)。
在 PHP7 中 String
现在是与 some others 一起的保留关键字. PHP-Parser 库使用了这个关键字,但从 fixed in April 2015 开始.尝试升级 PHP-Parser 库,这应该会有所帮助。
关于laravel-5 - 不能使用 'PhpParser\Node\Scalar\String' 作为类名,因为它是保留的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34200096/