mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-12-13 17:47:23 +01:00
98f7f39d1c
Not adding any explicit FPPP support, as I don't think add/remove of names can be handled any better than full reformatting.
62 lines
1.4 KiB
Plaintext
62 lines
1.4 KiB
Plaintext
Arbitrary expressions in new and instanceof
|
|
-----
|
|
<?php
|
|
|
|
new ('Foo' . $bar);
|
|
new ('Foo' . $bar)($arg);
|
|
$obj instanceof ('Foo' . $bar);
|
|
-----
|
|
!!php7
|
|
array(
|
|
0: Stmt_Expression(
|
|
expr: Expr_New(
|
|
class: Expr_BinaryOp_Concat(
|
|
left: Scalar_String(
|
|
value: Foo
|
|
)
|
|
right: Expr_Variable(
|
|
name: bar
|
|
)
|
|
)
|
|
args: array(
|
|
)
|
|
)
|
|
)
|
|
1: Stmt_Expression(
|
|
expr: Expr_New(
|
|
class: Expr_BinaryOp_Concat(
|
|
left: Scalar_String(
|
|
value: Foo
|
|
)
|
|
right: Expr_Variable(
|
|
name: bar
|
|
)
|
|
)
|
|
args: array(
|
|
0: Arg(
|
|
name: null
|
|
value: Expr_Variable(
|
|
name: arg
|
|
)
|
|
byRef: false
|
|
unpack: false
|
|
)
|
|
)
|
|
)
|
|
)
|
|
2: Stmt_Expression(
|
|
expr: Expr_Instanceof(
|
|
expr: Expr_Variable(
|
|
name: obj
|
|
)
|
|
class: Expr_BinaryOp_Concat(
|
|
left: Scalar_String(
|
|
value: Foo
|
|
)
|
|
right: Expr_Variable(
|
|
name: bar
|
|
)
|
|
)
|
|
)
|
|
)
|
|
) |