Skip to content

Commit

Permalink
Fix 5.3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Jul 11, 2024
1 parent fc73802 commit 7591529
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Seld/JsonLint/JsonParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ private function performAction($currentToken, $yytext, $yyleng, $yylineno, $yyst
$this->vstack[$len-2][$duplicateKey] = $this->vstack[$len][1];
} elseif (($this->flags & self::ALLOW_DUPLICATE_KEYS_TO_ARRAY) && isset($this->vstack[$len-2][$key])) {
if (!isset($this->vstack[$len-2][$key]['__duplicates__'])) {
$this->vstack[$len-2][$key] = ['__duplicates__' => [ $this->vstack[$len-2][$key] ]];
$this->vstack[$len-2][$key] = array('__duplicates__' => array($this->vstack[$len-2][$key]));
}
$this->vstack[$len-2][$key]['__duplicates__'][] = $this->vstack[$len][1];
} else {
Expand Down Expand Up @@ -526,7 +526,7 @@ private function performAction($currentToken, $yytext, $yyleng, $yylineno, $yyst
$this->vstack[$len-2]->$duplicateKey = $this->vstack[$len][1];
} elseif (($this->flags & self::ALLOW_DUPLICATE_KEYS_TO_ARRAY) && isset($this->vstack[$len-2]->$key)) {
if (!isset($this->vstack[$len-2]->$key->__duplicates__)) {
$this->vstack[$len-2]->$key = (object) ['__duplicates__' => [ $this->vstack[$len-2]->$key ]];
$this->vstack[$len-2]->$key = (object) array('__duplicates__' => array($this->vstack[$len-2]->$key));
}
$this->vstack[$len-2]->$key->__duplicates__[] = $this->vstack[$len][1];
} else {
Expand Down

0 comments on commit 7591529

Please sign in to comment.