Skip to content

Commit

Permalink
Merge pull request #16 from kornrunner/master
Browse files Browse the repository at this point in the history
DateTimeFormatter: PHP 8
  • Loading branch information
olvlvl authored Feb 16, 2021
2 parents 6213642 + b9b469c commit 23b6ac5
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 23b6ac5

Please sign in to comment.