1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-11-26 11:54:52 +01:00

Fix bug in pretty printer

This commit is contained in:
Daniil Gentili 2021-01-08 21:41:39 +01:00
parent 46221a0914
commit 9407d9a4b9
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -1032,8 +1032,11 @@ class Standard extends PrettyPrinterAbstract
}
protected function pNewVariable(Node $node) {
// TODO: This is not fully accurate.
return $this->pDereferenceLhs($node);
if (!$node instanceof Scalar\String_) {
return $this->pDereferenceLhs($node);
} else {
return '(' . $this->p($node) . ')';
}
}
/**