hprose/hprose-php

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

Opened this issue · 3 comments

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

andot commented

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

那个不是取数组元素,是取字符串的字符的写法。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 commented

已修复