1Trailing comma in parameter list 2----- 3<?php 4 5function foo($bar, ) { 6} 7----- 8array( 9 0: Stmt_Function( 10 attrGroups: array( 11 ) 12 byRef: false 13 name: Identifier( 14 name: foo 15 ) 16 params: array( 17 0: Param( 18 attrGroups: array( 19 ) 20 flags: 0 21 type: null 22 byRef: false 23 variadic: false 24 var: Expr_Variable( 25 name: bar 26 ) 27 default: null 28 hooks: array( 29 ) 30 ) 31 ) 32 returnType: null 33 stmts: array( 34 ) 35 ) 36) 37----- 38<?php 39 40class Foo 41{ 42 function __construct($name, $value, ) 43 { 44 } 45} 46----- 47array( 48 0: Stmt_Class( 49 attrGroups: array( 50 ) 51 flags: 0 52 name: Identifier( 53 name: Foo 54 ) 55 extends: null 56 implements: array( 57 ) 58 stmts: array( 59 0: Stmt_ClassMethod( 60 attrGroups: array( 61 ) 62 flags: 0 63 byRef: false 64 name: Identifier( 65 name: __construct 66 ) 67 params: array( 68 0: Param( 69 attrGroups: array( 70 ) 71 flags: 0 72 type: null 73 byRef: false 74 variadic: false 75 var: Expr_Variable( 76 name: name 77 ) 78 default: null 79 hooks: array( 80 ) 81 ) 82 1: Param( 83 attrGroups: array( 84 ) 85 flags: 0 86 type: null 87 byRef: false 88 variadic: false 89 var: Expr_Variable( 90 name: value 91 ) 92 default: null 93 hooks: array( 94 ) 95 ) 96 ) 97 returnType: null 98 stmts: array( 99 ) 100 ) 101 ) 102 ) 103) 104----- 105<?php 106fn($foo, ) => $bar; 107----- 108array( 109 0: Stmt_Expression( 110 expr: Expr_ArrowFunction( 111 attrGroups: array( 112 ) 113 static: false 114 byRef: false 115 params: array( 116 0: Param( 117 attrGroups: array( 118 ) 119 flags: 0 120 type: null 121 byRef: false 122 variadic: false 123 var: Expr_Variable( 124 name: foo 125 ) 126 default: null 127 hooks: array( 128 ) 129 ) 130 ) 131 returnType: null 132 expr: Expr_Variable( 133 name: bar 134 ) 135 ) 136 ) 137) 138