Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

aditya_abacus's avatar

Error on php artisan command

Hello,

I am getting below error whenever i run any command of php artisan, please check and help me out:

Parse error: parse error, expecting '&'' or"variable (T_VARIABLE)"' in /Users/Aditya/Documents/laravel/Gapp/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 475

0 likes
8 replies
tykus's avatar

What PHP version are you using?

aditya_abacus's avatar

I am using 5.6 php version. Because in 5.5 i was getting laravel 5.2 version.

RavenFaramond's avatar

Did you modify vendor/laravel/framework/src/Illuminate/Foundation/helpers.php ? If you did, you shouldn't really touch files in the vendor folder.

aditya_abacus's avatar

No, i have just created a new project and when i was about to run php artisan make:auth then i got this message.

RavenFaramond's avatar

The only thing I can think of is that maybe your PHP version doesn't support the splat operator.

aditya_abacus's avatar

I am using same php version on windows and it's working absolutely fine on windows. And i have same php version on mac but it's giving me this error on mac.

aditya_abacus's avatar

Hello,

Thanks everyone for support. I just got the issue, mac's default php version is 5.5 so whenever i open terminal i have to run export PATH=/usr/local/php5/bin:$PATH this command to use php 5.6 commands. Everything is working fine now.

Searching for how to change mac's default php version :P

Please or to participate in this conversation.