@@ -576,15 +576,15 @@ private function parseArrayShapeKey(TokenIterator $tokens)
576
576
577
577
} elseif ($ tokens ->isCurrentTokenType (Lexer::TOKEN_SINGLE_QUOTED_STRING )) {
578
578
if ($ this ->quoteAwareConstExprString ) {
579
- $ key = new Ast \ConstExpr \QuoteAwareConstExprStringNode (trim ($ tokens ->currentTokenValue (), " ' " ), Ast \ConstExpr \QuoteAwareConstExprStringNode::SINGLE_QUOTED );
579
+ $ key = new Ast \ConstExpr \QuoteAwareConstExprStringNode (StringUnescaper:: unescapeString ($ tokens ->currentTokenValue ()), Ast \ConstExpr \QuoteAwareConstExprStringNode::SINGLE_QUOTED );
580
580
} else {
581
581
$ key = new Ast \ConstExpr \ConstExprStringNode (trim ($ tokens ->currentTokenValue (), "' " ));
582
582
}
583
583
$ tokens ->next ();
584
584
585
585
} elseif ($ tokens ->isCurrentTokenType (Lexer::TOKEN_DOUBLE_QUOTED_STRING )) {
586
586
if ($ this ->quoteAwareConstExprString ) {
587
- $ key = new Ast \ConstExpr \QuoteAwareConstExprStringNode (trim ($ tokens ->currentTokenValue (), ' " ' ), Ast \ConstExpr \QuoteAwareConstExprStringNode::DOUBLE_QUOTED );
587
+ $ key = new Ast \ConstExpr \QuoteAwareConstExprStringNode (StringUnescaper:: unescapeString ($ tokens ->currentTokenValue ()), Ast \ConstExpr \QuoteAwareConstExprStringNode::DOUBLE_QUOTED );
588
588
} else {
589
589
$ key = new Ast \ConstExpr \ConstExprStringNode (trim ($ tokens ->currentTokenValue (), '" ' ));
590
590
}
@@ -645,15 +645,15 @@ private function parseObjectShapeKey(TokenIterator $tokens)
645
645
{
646
646
if ($ tokens ->isCurrentTokenType (Lexer::TOKEN_SINGLE_QUOTED_STRING )) {
647
647
if ($ this ->quoteAwareConstExprString ) {
648
- $ key = new Ast \ConstExpr \QuoteAwareConstExprStringNode (trim ($ tokens ->currentTokenValue (), " ' " ), Ast \ConstExpr \QuoteAwareConstExprStringNode::SINGLE_QUOTED );
648
+ $ key = new Ast \ConstExpr \QuoteAwareConstExprStringNode (StringUnescaper:: unescapeString ($ tokens ->currentTokenValue ()), Ast \ConstExpr \QuoteAwareConstExprStringNode::SINGLE_QUOTED );
649
649
} else {
650
650
$ key = new Ast \ConstExpr \ConstExprStringNode (trim ($ tokens ->currentTokenValue (), "' " ));
651
651
}
652
652
$ tokens ->next ();
653
653
654
654
} elseif ($ tokens ->isCurrentTokenType (Lexer::TOKEN_DOUBLE_QUOTED_STRING )) {
655
655
if ($ this ->quoteAwareConstExprString ) {
656
- $ key = new Ast \ConstExpr \QuoteAwareConstExprStringNode (trim ($ tokens ->currentTokenValue (), ' " ' ), Ast \ConstExpr \QuoteAwareConstExprStringNode::DOUBLE_QUOTED );
656
+ $ key = new Ast \ConstExpr \QuoteAwareConstExprStringNode (StringUnescaper:: unescapeString ($ tokens ->currentTokenValue ()), Ast \ConstExpr \QuoteAwareConstExprStringNode::DOUBLE_QUOTED );
657
657
} else {
658
658
$ key = new Ast \ConstExpr \ConstExprStringNode (trim ($ tokens ->currentTokenValue (), '" ' ));
659
659
}
0 commit comments