Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

i have error in laravel on function /vendor/guzzlehttp/psr7/src/functions.php on line 77 [duplicate]

I upload laravel 4 files on shared server and then i see this error.

Parse error: syntax error, unexpected '[' in . /vendor/guzzlehttp/psr7/src/functions.php on line 77

in line 77:

function stream_for($resource = '', array $options = [])

like image 672
Tirdad Avatar asked Dec 19 '22 02:12

Tirdad


1 Answers

Short array syntax [] was added in PHP 5.4, so I guess you're running some older version of PHP on the shared server. Normally replacing [] with array() would help, but here it is an external vendor package so it's not advised to modify the code as changes would be overwritten when vendor package is updated. Other than that the only way to fix that issue is to use newer version of PHP.

like image 166
jedrzej.kurylo Avatar answered Jan 26 '23 00:01

jedrzej.kurylo