Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP7.4 下2.0版本数组语法问题 #134

Open
hongbin-hsu opened this issue Mar 29, 2020 · 3 comments
Open

PHP7.4 下2.0版本数组语法问题 #134

hongbin-hsu opened this issue Mar 29, 2020 · 3 comments

Comments

@hongbin-hsu
Copy link

由于PHP7.4 不在支持 {0}这种数组写法,hprose2.0中有部份数组使用的大括号下标来表示数组;从而导致php7.4版本下报错;

@andot
Copy link
Member

andot commented Mar 29, 2020

那个不是取数组元素,是取字符串的字符的写法。7.4 确实不支持了。

@hongbin-hsu
Copy link
Author

那个不是取数组元素,是取字符串的字符的写法。7.4 确实不支持了。

PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in hprose/hprose/src/Hprose/Http/Service.php on line 112
hprose/hprose/src/Hprose/Http/Service.php on line 119

你要不要随手就修复一下?目前我是直接在composer 包中修改,不利于后面的维护

public function addAccessControlAllowOrigin($origin) {
    $count = strlen($origin);
    if (($count > 0) && ($originp[$count - 1] === "/")) {
        $origin = substr($origin, 0, -1);
    }
    $this->origins[strtolower($origin)] = true;
}
public function removeAccessControlAllowOrigin($origin) {
    $count = strlen($origin);
    if (($count > 0) && ($origin[$count - 1] === "/")) {
        $origin = substr($origin, 0, -1);
    }
    unset($this->origins[strtolower($origin)]);
}

andot added a commit that referenced this issue Mar 30, 2020
andot added a commit that referenced this issue Mar 30, 2020
@andot
Copy link
Member

andot commented Mar 30, 2020

已修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants