php-parser/test/code/parser/expr/fetchAndCall/args.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

115 lines
2.5 KiB
Plaintext

Arguments
-----
<?php
f();
f($a);
f($a, $b);
f(&$a);
f($a, ...$b);
-----
array(
0: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: f
)
)
args: array(
)
)
)
1: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: f
)
)
args: array(
0: Arg(
name: null
value: Expr_Variable(
name: a
)
byRef: false
unpack: false
)
)
)
)
2: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: f
)
)
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_FuncCall(
name: Name(
parts: array(
0: f
)
)
args: array(
0: Arg(
name: null
value: Expr_Variable(
name: a
)
byRef: true
unpack: false
)
)
)
)
4: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: f
)
)
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: true
)
)
)
)
)