Skip to content

Commit

Permalink
DateTimeFormatter: array and string offset access syntax with curly b…
Browse files Browse the repository at this point in the history
…races is no longer supported / PHP8
  • Loading branch information
kornrunner committed Feb 16, 2021
1 parent 6213642 commit b9b469c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/DateTimeFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand All @@ -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;
Expand Down Expand Up @@ -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'];
Expand Down

0 comments on commit b9b469c

Please sign in to comment.