Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot use 'PhpParser\Node\Scalar\String' as class name as it is reserved

When I use the composer to install Laravel 5 I get this error:

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

What is wrong?

like image 228
葛文瑞 Avatar asked Dec 02 '22 13:12

葛文瑞


1 Answers

I assume you are using PHP7 as you wouldn't get this error otherwise (?).

In PHP7 String is now a reserved keyword along with some others. The PHP-Parser library used this keyword but was since fixed in April 2015. Try upgrading the PHP-Parser library, this should help.

like image 168
SamV Avatar answered Dec 06 '22 06:12

SamV