I get error messages below while installing laravel by the composer:
...
Writing lock file
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize
PHP Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in /home/laptop/Dev/tasix.app/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 475
Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in /home/laptop/Dev/tasix.app/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 475
Script php artisan optimize handling the post-update-cmd event returned with error code 255
In the vendor/.../helpers.php file I found those lines of broken code [475-478]:
// ...
function event(...$args)
{
return app('events')->fire(...$args);
}
// ...
I just executed only one command:
php7.0 /usr/local/bin/composer create-project --prefer-dist laravel/laravel test.app
You must have PHP >= 5.6.4
I just believe the composer doesn't use your php7.0 version when installing, although you run it using php7.0 command. Do you use multiple php versions?
Problem isn't in PHP versions! Please, look at broken code.
What do you think, code written correctly?
_P.S. I'll try to install through homestead (v0.5.0)..._
@zvermafia
Problem isn't in PHP versions! Please, look at broken code.
What do you think, code written correctly?
P.S. I'll try to install through homestead (v0.5.0)...
// ...
function event(...$args)
{
return app('events')->fire(...$args);
}
// ...
If you're refering to the ... that's the splat operator and it's correctly wrritten.
You must have PHP >= 5.6.4
You need to make sure you're using a proper version of PHP, please continue on the forums as we try to keep this repo for bug reporting only.
I'm sorry :(
I didn't know about of the splat operator (thanks @fernandobandeira), I thought it a bug/typo...
Hi there, I got the same problem,
php artisan
Parse error: parse error in /Users/g../Documents/websites/New/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 233
I installed php 7.1 but after installing composer then laravel, checking the php version using _php -v_ in Terminal,
php 5.5.38
Is there anyone who knows how to install php in this case?
@Gedeonnibango1 https://php-osx.liip.ch/ should work. If you have any more issues regarding running the correct PHP version, please refer to the forums, since this is intended for bug reports only.
@CupOfTea696 Than you so much indeed. PHP https://php-osx.liip.ch/ Worked.
How about window, how to resolve?
Most helpful comment
@zvermafia
If you're refering to the
...that's the splat operator and it's correctly wrritten.You must have PHP >= 5.6.4