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

自古美人都是妖i 提交于 2019-12-07 08:40:52

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!