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)) {