comparison vendor/nikic/php-parser/test/code/parser/stmt/function/variadic.test @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 5fb285c0d0e3
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 Variadic functions
2 -----
3 <?php
4 function test($a, ... $b) {}
5 function test($a, &... $b) {}
6 function test($a, Type ... $b) {}
7 function test($a, Type &... $b) {}
8 -----
9 array(
10 0: Stmt_Function(
11 byRef: false
12 name: test
13 params: array(
14 0: Param(
15 type: null
16 byRef: false
17 variadic: false
18 name: a
19 default: null
20 )
21 1: Param(
22 type: null
23 byRef: false
24 variadic: true
25 name: b
26 default: null
27 )
28 )
29 returnType: null
30 stmts: array(
31 )
32 )
33 1: Stmt_Function(
34 byRef: false
35 name: test
36 params: array(
37 0: Param(
38 type: null
39 byRef: false
40 variadic: false
41 name: a
42 default: null
43 )
44 1: Param(
45 type: null
46 byRef: true
47 variadic: true
48 name: b
49 default: null
50 )
51 )
52 returnType: null
53 stmts: array(
54 )
55 )
56 2: Stmt_Function(
57 byRef: false
58 name: test
59 params: array(
60 0: Param(
61 type: null
62 byRef: false
63 variadic: false
64 name: a
65 default: null
66 )
67 1: Param(
68 type: Name(
69 parts: array(
70 0: Type
71 )
72 )
73 byRef: false
74 variadic: true
75 name: b
76 default: null
77 )
78 )
79 returnType: null
80 stmts: array(
81 )
82 )
83 3: Stmt_Function(
84 byRef: false
85 name: test
86 params: array(
87 0: Param(
88 type: null
89 byRef: false
90 variadic: false
91 name: a
92 default: null
93 )
94 1: Param(
95 type: Name(
96 parts: array(
97 0: Type
98 )
99 )
100 byRef: true
101 variadic: true
102 name: b
103 default: null
104 )
105 )
106 returnType: null
107 stmts: array(
108 )
109 )
110 )