diff --git a/system/Entity.php b/system/Entity.php index 655bbb854300..7f851d80e58e 100644 --- a/system/Entity.php +++ b/system/Entity.php @@ -602,7 +602,7 @@ private function castAsJson($value, bool $asArray = false) $tmp = ! is_null($value) ? ($asArray ? [] : new \stdClass) : null; if (function_exists('json_decode')) { - if ((is_string($value) && strlen($value) > 1 && in_array($value{0}, ['[', '{', '"'])) || is_numeric($value)) + if ((is_string($value) && strlen($value) > 1 && in_array($value[0], ['[', '{', '"'])) || is_numeric($value)) { $tmp = json_decode($value, $asArray);