Skip to content

Commit af944a3

Browse files
committed
Remove a TODO that no longer applies in php 8.0
Any expression can be used as of 8.0 without an unexpected syntax error. In encapsulated strings, `"${a->prop}"` is equivalent to `"{${(a->prop)}}"` in php 8.0 and a syntax error in previous php versions. (Get the property `prop` of the global constant `a` (constants can be objects in php 8.1), then get the variable with the name equal to that string)
1 parent ecc2be1 commit af944a3

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/Parser.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,8 +1324,6 @@ private function parseStringLiteralExpression2($parentNode) {
13241324
case TokenKind::DollarOpenBraceToken:
13251325
case TokenKind::OpenBraceDollarToken:
13261326
$expression->children[] = $this->eat(TokenKind::DollarOpenBraceToken, TokenKind::OpenBraceDollarToken);
1327-
// TODO: Reject ${var->prop} and ${(var->prop)} without rejecting ${var+otherVar}
1328-
// Currently, this fails to reject ${var->prop} (because `var` has TokenKind::Name instead of StringVarname)
13291327
if ($this->getCurrentToken()->kind === TokenKind::StringVarname) {
13301328
$expression->children[] = $this->parseComplexDollarTemplateStringExpression($expression);
13311329
} else {

0 commit comments

Comments
 (0)