gpt4 book ai didi

php - 解析_str() : Calling parse_str() without the result argument is deprecated in jwage/purl

转载 作者:行者123 更新时间:2023-12-01 18:05:56 37 4
gpt4 key购买 nike

public function postIndex(){

$url = new Url('https://www.dropbox.com/1/oauth2/authorize');

$url->query->setData([
'response_type'=>'code',
'client_id'=> env('DROPBOX_APP_KEY'),
'redirect_uri'=> env('DROPBOX_REDIRECT_URI')
]);

purl类中定义的parse_str只需要一个参数

protected function doInitialize()
{
parse_str($this->query);

$this->data = get_defined_vars();
}

我当前的php版本是7.1.17。它需要第二个“结果”参数,我应该如何传递第二个必需参数来摆脱这个错误

提前致谢。

最佳答案

According to the documentationparse_str 直到 7.2 才开始引发弃用警告,但无论如何,转向双参数用法是有意义的。

值得庆幸的是,该代码示例非常简单,并且可以轻松更新,如下所示:

protected function doInitialize()
{
parse_str($this->query, $this->data);
}

jwage/purl 库已经 had basically this exact fix applied ,但从那时起它看起来并没有被重新标记,因此如果您通过 Composer 将其拉入,则需要手动 require the master branch .

关于php - 解析_str() : Calling parse_str() without the result argument is deprecated in jwage/purl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50061424/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com