问题
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 = [])
回答1:
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.
来源:https://stackoverflow.com/questions/31367442/i-have-error-in-laravel-on-function-vendor-guzzlehttp-psr7-src-functions-php-on