mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-30 04:01:47 +00:00
Fix #32: Replace function array dereferencing syntax to avoid syntax errors < PHP 5.4.0
This commit is contained in:
+8
-2
@@ -388,7 +388,8 @@ class CaseInsensitiveArray implements ArrayAccess, Countable, Iterator
|
||||
} else {
|
||||
$index = array_search(strtolower($offset), array_keys(array_change_key_case($this->container, CASE_LOWER)));
|
||||
if (!($index === false)) {
|
||||
unset($this->container[array_keys($this->container)[$index]]);
|
||||
$keys = array_keys($this->container);
|
||||
unset($this->container[$keys[$index]]);
|
||||
}
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
@@ -407,7 +408,12 @@ class CaseInsensitiveArray implements ArrayAccess, Countable, Iterator
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
$index = array_search(strtolower($offset), array_keys(array_change_key_case($this->container, CASE_LOWER)));
|
||||
return $index === false ? null : array_values($this->container)[$index];
|
||||
if ($index === false) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$values = array_values($this->container);
|
||||
return $values[$index];
|
||||
}
|
||||
|
||||
public function count()
|
||||
|
||||
Reference in New Issue
Block a user