2020-06-12 19:14:34 +02:00
|
|
|
Trailing comma in parameter list
|
|
|
|
-----
|
|
|
|
<?php
|
|
|
|
|
|
|
|
function foo($bar, ) {
|
|
|
|
}
|
|
|
|
-----
|
|
|
|
!!php7
|
|
|
|
array(
|
|
|
|
0: Stmt_Function(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2020-06-12 19:14:34 +02:00
|
|
|
byRef: false
|
|
|
|
name: Identifier(
|
|
|
|
name: foo
|
|
|
|
)
|
|
|
|
params: array(
|
|
|
|
0: Param(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2020-06-07 18:52:12 +02:00
|
|
|
flags: 0
|
2020-06-12 19:14:34 +02:00
|
|
|
type: null
|
|
|
|
byRef: false
|
|
|
|
variadic: false
|
|
|
|
var: Expr_Variable(
|
|
|
|
name: bar
|
|
|
|
)
|
|
|
|
default: null
|
|
|
|
)
|
|
|
|
)
|
|
|
|
returnType: null
|
|
|
|
stmts: array(
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
-----
|
|
|
|
<?php
|
|
|
|
|
|
|
|
class Foo
|
|
|
|
{
|
|
|
|
function __construct($name, $value, )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
-----
|
|
|
|
!!php7
|
|
|
|
array(
|
|
|
|
0: Stmt_Class(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2020-06-12 19:14:34 +02:00
|
|
|
flags: 0
|
|
|
|
name: Identifier(
|
|
|
|
name: Foo
|
|
|
|
)
|
|
|
|
extends: null
|
|
|
|
implements: array(
|
|
|
|
)
|
|
|
|
stmts: array(
|
|
|
|
0: Stmt_ClassMethod(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2020-06-12 19:14:34 +02:00
|
|
|
flags: 0
|
|
|
|
byRef: false
|
|
|
|
name: Identifier(
|
|
|
|
name: __construct
|
|
|
|
)
|
|
|
|
params: array(
|
|
|
|
0: Param(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2020-06-07 18:52:12 +02:00
|
|
|
flags: 0
|
2020-06-12 19:14:34 +02:00
|
|
|
type: null
|
|
|
|
byRef: false
|
|
|
|
variadic: false
|
|
|
|
var: Expr_Variable(
|
|
|
|
name: name
|
|
|
|
)
|
|
|
|
default: null
|
|
|
|
)
|
|
|
|
1: Param(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2020-06-07 18:52:12 +02:00
|
|
|
flags: 0
|
2020-06-12 19:14:34 +02:00
|
|
|
type: null
|
|
|
|
byRef: false
|
|
|
|
variadic: false
|
|
|
|
var: Expr_Variable(
|
|
|
|
name: value
|
|
|
|
)
|
|
|
|
default: null
|
|
|
|
)
|
|
|
|
)
|
|
|
|
returnType: null
|
|
|
|
stmts: array(
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
-----
|
|
|
|
<?php
|
|
|
|
fn($foo, ) => $bar;
|
|
|
|
-----
|
|
|
|
!!php7
|
|
|
|
array(
|
|
|
|
0: Stmt_Expression(
|
|
|
|
expr: Expr_ArrowFunction(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2020-06-12 19:14:34 +02:00
|
|
|
static: false
|
|
|
|
byRef: false
|
|
|
|
params: array(
|
|
|
|
0: Param(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2020-06-07 18:52:12 +02:00
|
|
|
flags: 0
|
2020-06-12 19:14:34 +02:00
|
|
|
type: null
|
|
|
|
byRef: false
|
|
|
|
variadic: false
|
|
|
|
var: Expr_Variable(
|
|
|
|
name: foo
|
|
|
|
)
|
|
|
|
default: null
|
|
|
|
)
|
|
|
|
)
|
|
|
|
returnType: null
|
|
|
|
expr: Expr_Variable(
|
|
|
|
name: bar
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2020-06-07 18:52:12 +02:00
|
|
|
)
|