Fix #18505: Fixed ArrayHelper::get() for ArrayAccess objects with explicitly defined properties

Co-authored-by: Bizley <pawel@positive.codes>
This commit is contained in:
Alexander Makarov
2021-02-04 15:30:56 +03:00
committed by GitHub
parent 95c2d214d9
commit 71791d790d
3 changed files with 34 additions and 0 deletions

View File

@ -196,6 +196,10 @@ class BaseArrayHelper
$key = $lastKey;
}
if (is_object($array) && property_exists($array, $key)) {
return $array->$key;
}
if (static::keyExists($key, $array)) {
return $array[$key];
}