From b9b469c1984e54b2a2918b2f69b9b569d503d857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boris=20Mom=C4=8Dilovi=C4=87?= Date: Tue, 16 Feb 2021 13:45:00 +0100 Subject: [PATCH] DateTimeFormatter: array and string offset access syntax with curly braces is no longer supported / PHP8 --- lib/DateTimeFormatter.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/DateTimeFormatter.php b/lib/DateTimeFormatter.php index 0d173cc..fab68fc 100644 --- a/lib/DateTimeFormatter.php +++ b/lib/DateTimeFormatter.php @@ -99,11 +99,11 @@ static protected function tokenize($pattern) for ($i = 0, $n = strlen($pattern) ; $i < $n ; ++$i) { - $c = $pattern{$i}; + $c = $pattern[$i]; if ($c === "'") { - if ($i < $n-1 && $pattern{$i+1} === "'") + if ($i < $n-1 && $pattern[$i+1] === "'") { $tokens[] = "'"; $i++; @@ -128,7 +128,7 @@ static protected function tokenize($pattern) { for ($j = $i + 1 ; $j < $n ; ++$j) { - if ($pattern{$j} !== $c) break; + if ($pattern[$j] !== $c) break; } $l = $j-$i; @@ -267,7 +267,7 @@ protected function resolve_pattern($pattern_or_width_or_skeleton) { $pattern = $pattern_or_width_or_skeleton; - if ($pattern_or_width_or_skeleton{0} === ':') + if ($pattern_or_width_or_skeleton[0] === ':') { $skeleton = substr($pattern, 1); $available_formats = $this->calendar['dateTimeFormats']['availableFormats'];