1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-12 09:29:47 +01:00
PHP-Parser/test/code/prettyPrinter/expr/newVariable.test
Nikita Popov 8bcaa4261e Add parens for new/instanceof with complex expression
This is not fully accurate because the rules for "new variables"
are different than the rules for dereferenceable LHS.
2020-08-09 22:07:33 +02:00

11 lines
209 B
Plaintext

Parentheses for complex new/instanceof expressions
-----
<?php
new ('a' . 'b');
$x instanceof ('a' . 'b');
$x instanceof ($y++);
-----
!!php7
new ('a' . 'b')();
$x instanceof ('a' . 'b');
$x instanceof ($y++);