1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-04 02:07:59 +01:00
PHP-Parser/test/code/parser/expr/trailingCommas.test
Nikita Popov 98f7f39d1c Add named argument support
Not adding any explicit FPPP support, as I don't think add/remove
of names can be handled any better than full reformatting.
2020-08-09 17:37:44 +02:00

148 lines
3.4 KiB
Plaintext

PHP 7.3 trailing comma additions
-----
<?php
foo($a, $b, );
$foo->bar($a, $b, );
Foo::bar($a, $b, );
new Foo($a, $b, );
unset($a, $b, );
isset($a, $b, );
-----
!!php7
array(
0: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: foo
)
)
args: array(
0: Arg(
name: null
value: Expr_Variable(
name: a
)
byRef: false
unpack: false
)
1: Arg(
name: null
value: Expr_Variable(
name: b
)
byRef: false
unpack: false
)
)
)
)
1: Stmt_Expression(
expr: Expr_MethodCall(
var: Expr_Variable(
name: foo
)
name: Identifier(
name: bar
)
args: array(
0: Arg(
name: null
value: Expr_Variable(
name: a
)
byRef: false
unpack: false
)
1: Arg(
name: null
value: Expr_Variable(
name: b
)
byRef: false
unpack: false
)
)
)
)
2: Stmt_Expression(
expr: Expr_StaticCall(
class: Name(
parts: array(
0: Foo
)
)
name: Identifier(
name: bar
)
args: array(
0: Arg(
name: null
value: Expr_Variable(
name: a
)
byRef: false
unpack: false
)
1: Arg(
name: null
value: Expr_Variable(
name: b
)
byRef: false
unpack: false
)
)
)
)
3: Stmt_Expression(
expr: Expr_New(
class: Name(
parts: array(
0: Foo
)
)
args: array(
0: Arg(
name: null
value: Expr_Variable(
name: a
)
byRef: false
unpack: false
)
1: Arg(
name: null
value: Expr_Variable(
name: b
)
byRef: false
unpack: false
)
)
)
)
4: Stmt_Unset(
vars: array(
0: Expr_Variable(
name: a
)
1: Expr_Variable(
name: b
)
)
)
5: Stmt_Expression(
expr: Expr_Isset(
vars: array(
0: Expr_Variable(
name: a
)
1: Expr_Variable(
name: b
)
)
)
)
)