1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-04 18:28:25 +01:00
PHP-Parser/test/code/parser/expr/uvs/indirectCall.test

511 lines
17 KiB
Plaintext
Raw Normal View History

2015-06-13 15:42:09 +02:00
UVS indirect calls
-----
<?php
id('var_dump')(1);
id('id')('var_dump')(2);
id()()('var_dump')(4);
id(['udef', 'id'])[1]()('var_dump')(5);
(function($x) { return $x; })('id')('var_dump')(8);
($f = function($x = null) use (&$f) {
return $x ?: $f;
})()()()('var_dump')(9);
[$obj, 'id']()('id')($id)('var_dump')(10);
'id'()('id')('var_dump')(12);
('i' . 'd')()('var_dump')(13);
'\id'('var_dump')(14);
-----
!!php7
array(
2017-01-19 22:25:22 +01:00
0: Stmt_Expression(
expr: Expr_FuncCall(
2015-06-13 15:42:09 +02:00
name: Expr_FuncCall(
name: Name(
parts: array(
0: id
)
)
args: array(
0: Arg(
value: Scalar_String(
2017-01-19 22:25:22 +01:00
value: var_dump
2015-06-13 15:42:09 +02:00
)
byRef: false
unpack: false
)
)
)
args: array(
0: Arg(
2017-01-19 22:25:22 +01:00
value: Scalar_LNumber(
value: 1
2015-06-13 15:42:09 +02:00
)
byRef: false
unpack: false
)
)
)
)
2017-01-19 22:25:22 +01:00
1: Stmt_Expression(
expr: Expr_FuncCall(
2015-06-13 15:42:09 +02:00
name: Expr_FuncCall(
name: Expr_FuncCall(
name: Name(
parts: array(
0: id
)
)
args: array(
2017-01-19 22:25:22 +01:00
0: Arg(
value: Scalar_String(
value: id
)
byRef: false
unpack: false
)
2015-06-13 15:42:09 +02:00
)
)
args: array(
2017-01-19 22:25:22 +01:00
0: Arg(
value: Scalar_String(
value: var_dump
)
byRef: false
unpack: false
)
2015-06-13 15:42:09 +02:00
)
)
args: array(
0: Arg(
2017-01-19 22:25:22 +01:00
value: Scalar_LNumber(
value: 2
2015-06-13 15:42:09 +02:00
)
byRef: false
unpack: false
)
)
)
)
2017-01-19 22:25:22 +01:00
2: Stmt_Expression(
expr: Expr_FuncCall(
2015-06-13 15:42:09 +02:00
name: Expr_FuncCall(
2017-01-19 22:25:22 +01:00
name: Expr_FuncCall(
name: Expr_FuncCall(
2015-06-13 15:42:09 +02:00
name: Name(
parts: array(
0: id
)
)
args: array(
2017-01-19 22:25:22 +01:00
)
)
args: array(
)
)
args: array(
0: Arg(
value: Scalar_String(
value: var_dump
)
byRef: false
unpack: false
)
)
)
args: array(
0: Arg(
value: Scalar_LNumber(
value: 4
)
byRef: false
unpack: false
)
)
)
)
3: Stmt_Expression(
expr: Expr_FuncCall(
name: Expr_FuncCall(
name: Expr_FuncCall(
name: Expr_ArrayDimFetch(
var: Expr_FuncCall(
name: Name(
parts: array(
0: id
)
)
args: array(
0: Arg(
value: Expr_Array(
items: array(
0: Expr_ArrayItem(
key: null
value: Scalar_String(
value: udef
)
byRef: false
2019-05-09 15:11:00 +02:00
unpack: false
2015-06-13 15:42:09 +02:00
)
2017-01-19 22:25:22 +01:00
1: Expr_ArrayItem(
key: null
value: Scalar_String(
value: id
)
byRef: false
2019-05-09 15:11:00 +02:00
unpack: false
2015-06-13 15:42:09 +02:00
)
)
)
2017-01-19 22:25:22 +01:00
byRef: false
unpack: false
2015-06-13 15:42:09 +02:00
)
)
)
2017-01-19 22:25:22 +01:00
dim: Scalar_LNumber(
value: 1
)
2015-06-13 15:42:09 +02:00
)
2017-01-19 22:25:22 +01:00
args: array(
2015-06-13 15:42:09 +02:00
)
)
args: array(
2017-01-19 22:25:22 +01:00
0: Arg(
value: Scalar_String(
value: var_dump
)
byRef: false
unpack: false
)
2015-06-13 15:42:09 +02:00
)
)
args: array(
0: Arg(
2017-01-19 22:25:22 +01:00
value: Scalar_LNumber(
value: 5
2015-06-13 15:42:09 +02:00
)
byRef: false
unpack: false
)
)
)
)
2017-01-19 22:25:22 +01:00
4: Stmt_Expression(
expr: Expr_FuncCall(
2015-06-13 15:42:09 +02:00
name: Expr_FuncCall(
2017-01-19 22:25:22 +01:00
name: Expr_FuncCall(
name: Expr_Closure(
static: false
byRef: false
params: array(
0: Param(
type: null
byRef: false
variadic: false
var: Expr_Variable(
2017-01-19 23:23:38 +01:00
name: x
)
2017-01-19 22:25:22 +01:00
default: null
)
)
uses: array(
)
returnType: null
stmts: array(
0: Stmt_Return(
expr: Expr_Variable(
name: x
)
)
2015-06-13 15:42:09 +02:00
)
)
2017-01-19 22:25:22 +01:00
args: array(
0: Arg(
value: Scalar_String(
value: id
2015-06-13 15:42:09 +02:00
)
2017-01-19 22:25:22 +01:00
byRef: false
unpack: false
2015-06-13 15:42:09 +02:00
)
)
)
args: array(
0: Arg(
value: Scalar_String(
2017-01-19 22:25:22 +01:00
value: var_dump
2015-06-13 15:42:09 +02:00
)
byRef: false
unpack: false
)
)
)
args: array(
0: Arg(
2017-01-19 22:25:22 +01:00
value: Scalar_LNumber(
value: 8
2015-06-13 15:42:09 +02:00
)
byRef: false
unpack: false
)
)
)
)
2017-01-19 22:25:22 +01:00
5: Stmt_Expression(
expr: Expr_FuncCall(
2015-06-13 15:42:09 +02:00
name: Expr_FuncCall(
name: Expr_FuncCall(
name: Expr_FuncCall(
2017-01-19 22:25:22 +01:00
name: Expr_FuncCall(
name: Expr_Assign(
var: Expr_Variable(
name: f
)
expr: Expr_Closure(
static: false
byRef: false
params: array(
0: Param(
type: null
byRef: false
variadic: false
var: Expr_Variable(
2017-01-19 23:23:38 +01:00
name: x
)
2017-01-19 22:25:22 +01:00
default: Expr_ConstFetch(
name: Name(
parts: array(
0: null
)
2015-06-13 15:42:09 +02:00
)
)
)
)
2017-01-19 22:25:22 +01:00
uses: array(
0: Expr_ClosureUse(
2017-01-19 23:23:38 +01:00
var: Expr_Variable(
name: f
)
2017-01-19 22:25:22 +01:00
byRef: true
)
2015-06-13 15:42:09 +02:00
)
2017-01-19 22:25:22 +01:00
returnType: null
stmts: array(
0: Stmt_Return(
expr: Expr_Ternary(
cond: Expr_Variable(
name: x
)
if: null
else: Expr_Variable(
name: f
)
2015-06-13 15:42:09 +02:00
)
)
)
)
)
2017-01-19 22:25:22 +01:00
args: array(
)
2015-06-13 15:42:09 +02:00
)
args: array(
)
)
args: array(
)
)
args: array(
2017-01-19 22:25:22 +01:00
0: Arg(
value: Scalar_String(
value: var_dump
)
byRef: false
unpack: false
)
2015-06-13 15:42:09 +02:00
)
)
args: array(
0: Arg(
2017-01-19 22:25:22 +01:00
value: Scalar_LNumber(
value: 9
2015-06-13 15:42:09 +02:00
)
byRef: false
unpack: false
)
)
)
)
2017-01-19 22:25:22 +01:00
6: Stmt_Expression(
expr: Expr_FuncCall(
2015-06-13 15:42:09 +02:00
name: Expr_FuncCall(
name: Expr_FuncCall(
name: Expr_FuncCall(
2017-01-19 22:25:22 +01:00
name: Expr_FuncCall(
name: Expr_Array(
items: array(
0: Expr_ArrayItem(
key: null
value: Expr_Variable(
name: obj
)
byRef: false
2019-05-09 15:11:00 +02:00
unpack: false
2015-06-13 15:42:09 +02:00
)
2017-01-19 22:25:22 +01:00
1: Expr_ArrayItem(
key: null
value: Scalar_String(
value: id
)
byRef: false
2019-05-09 15:11:00 +02:00
unpack: false
2015-06-13 15:42:09 +02:00
)
)
)
2017-01-19 22:25:22 +01:00
args: array(
)
2015-06-13 15:42:09 +02:00
)
args: array(
2017-01-19 22:25:22 +01:00
0: Arg(
value: Scalar_String(
value: id
)
byRef: false
unpack: false
)
2015-06-13 15:42:09 +02:00
)
)
args: array(
0: Arg(
2017-01-19 22:25:22 +01:00
value: Expr_Variable(
name: id
2015-06-13 15:42:09 +02:00
)
byRef: false
unpack: false
)
)
)
args: array(
0: Arg(
2017-01-19 22:25:22 +01:00
value: Scalar_String(
value: var_dump
2015-06-13 15:42:09 +02:00
)
byRef: false
unpack: false
)
)
)
args: array(
0: Arg(
2017-01-19 22:25:22 +01:00
value: Scalar_LNumber(
value: 10
2015-06-13 15:42:09 +02:00
)
byRef: false
unpack: false
)
)
)
)
2017-01-19 22:25:22 +01:00
7: Stmt_Expression(
expr: Expr_FuncCall(
2015-06-13 15:42:09 +02:00
name: Expr_FuncCall(
name: Expr_FuncCall(
2017-01-19 22:25:22 +01:00
name: Expr_FuncCall(
name: Scalar_String(
value: id
)
args: array(
)
2015-06-13 15:42:09 +02:00
)
args: array(
2017-01-19 22:25:22 +01:00
0: Arg(
value: Scalar_String(
value: id
)
byRef: false
unpack: false
)
2015-06-13 15:42:09 +02:00
)
)
args: array(
0: Arg(
value: Scalar_String(
2017-01-19 22:25:22 +01:00
value: var_dump
2015-06-13 15:42:09 +02:00
)
byRef: false
unpack: false
)
)
)
args: array(
0: Arg(
2017-01-19 22:25:22 +01:00
value: Scalar_LNumber(
value: 12
2015-06-13 15:42:09 +02:00
)
byRef: false
unpack: false
)
)
)
)
2017-01-19 22:25:22 +01:00
8: Stmt_Expression(
expr: Expr_FuncCall(
2015-06-13 15:42:09 +02:00
name: Expr_FuncCall(
2017-01-19 22:25:22 +01:00
name: Expr_FuncCall(
name: Expr_BinaryOp_Concat(
left: Scalar_String(
value: i
)
right: Scalar_String(
value: d
)
2015-06-13 15:42:09 +02:00
)
2017-01-19 22:25:22 +01:00
args: array(
2015-06-13 15:42:09 +02:00
)
)
args: array(
2017-01-19 22:25:22 +01:00
0: Arg(
value: Scalar_String(
value: var_dump
)
byRef: false
unpack: false
)
2015-06-13 15:42:09 +02:00
)
)
args: array(
0: Arg(
2017-01-19 22:25:22 +01:00
value: Scalar_LNumber(
value: 13
2015-06-13 15:42:09 +02:00
)
byRef: false
unpack: false
)
)
)
)
2017-01-19 22:25:22 +01:00
9: Stmt_Expression(
expr: Expr_FuncCall(
name: Expr_FuncCall(
name: Scalar_String(
value: \id
)
args: array(
0: Arg(
value: Scalar_String(
value: var_dump
)
byRef: false
unpack: false
)
)
2015-06-13 15:42:09 +02:00
)
args: array(
0: Arg(
2017-01-19 22:25:22 +01:00
value: Scalar_LNumber(
value: 14
2015-06-13 15:42:09 +02:00
)
byRef: false
unpack: false
)
)
)
)
2017-01-19 22:25:22 +01:00
)