diff --git a/core/modules/rest/src/RequestHandler.php b/core/modules/rest/src/RequestHandler.php
index bc93538c498cca8ae086d61d3dccab26fcc7eacc..e1c424aa7c67a36640a2714d064573940a2bc993 100644
--- a/core/modules/rest/src/RequestHandler.php
+++ b/core/modules/rest/src/RequestHandler.php
@@ -336,7 +336,7 @@ protected function getLegacyParameters(RouteMatchInterface $route_match, $unseri
     $parameters = [];
     // Filter out all internal parameters starting with "_".
     foreach ($route_parameters as $key => $parameter) {
-      if ($key{0} !== '_') {
+      if (substr((string) $key, 0, 1) !== '_') {
         $parameters[] = $parameter;
       }
     }
diff --git a/core/modules/search/src/SearchQuery.php b/core/modules/search/src/SearchQuery.php
index 9e47cf1a4263ebcdea7681b4a5707234e97a41c1..6e342ca202c168c5520345d85ffb89aca7bac882 100644
--- a/core/modules/search/src/SearchQuery.php
+++ b/core/modules/search/src/SearchQuery.php
@@ -246,7 +246,7 @@ protected function parseSearchExpression() {
 
       // Strip off phrase quotes.
       $phrase = FALSE;
-      if ($match[2]{0} == '"') {
+      if ($match[2][0] == '"') {
         $match[2] = substr($match[2], 1, -1);
         $phrase = TRUE;
         $this->simple = FALSE;
diff --git a/core/modules/views/src/Plugin/views/filter/StringFilter.php b/core/modules/views/src/Plugin/views/filter/StringFilter.php
index 47adcdbcdd09b58bed7d5463eac6a4775e5b1c7d..229eb907332f6cdc3c97e634fad0adebb15895b8 100644
--- a/core/modules/views/src/Plugin/views/filter/StringFilter.php
+++ b/core/modules/views/src/Plugin/views/filter/StringFilter.php
@@ -341,7 +341,7 @@ protected function opContainsWord($field) {
     foreach ($matches as $match) {
       $phrase = FALSE;
       // Strip off phrase quotes
-      if ($match[2]{0} == '"') {
+      if ($match[2][0] == '"') {
         $match[2] = substr($match[2], 1, -1);
         $phrase = TRUE;
       }