From a9324e0f91703785d379b8d9e287c868c3c06561 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Tue, 21 May 2024 14:30:46 +0700 Subject: [PATCH] Fix --- src/ArArrayHelper.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ArArrayHelper.php b/src/ArArrayHelper.php index 96728eec4..661623abb 100644 --- a/src/ArArrayHelper.php +++ b/src/ArArrayHelper.php @@ -96,7 +96,8 @@ public static function getValueByPath(ActiveRecordInterface|array $array, string } if (property_exists($array, $key)) { - return get_object_vars($array)[$key] ?? $default; + $values = get_object_vars($array); + return array_key_exists($key, $values) ? $values[$key] : $default; } if ($array->isRelationPopulated($key)) {