Mercurial > hg > isophonics-drupal-site
annotate vendor/nikic/php-parser/test/code/parser/expr/closure.test @ 1:1a348b17ec81
Logo and header background
author | Chris Cannam |
---|---|
date | Thu, 30 Nov 2017 14:56:35 +0000 |
parents | 4c8ae668cc8c |
children | 5fb285c0d0e3 |
rev | line source |
---|---|
Chris@0 | 1 Closures |
Chris@0 | 2 ----- |
Chris@0 | 3 <?php |
Chris@0 | 4 function($a) { $a; }; |
Chris@0 | 5 function($a) use($b) {}; |
Chris@0 | 6 function() use($a, &$b) {}; |
Chris@0 | 7 function &($a) {}; |
Chris@0 | 8 static function() {}; |
Chris@0 | 9 function($a) : array {}; |
Chris@0 | 10 function() use($a) : \Foo\Bar {}; |
Chris@0 | 11 ----- |
Chris@0 | 12 array( |
Chris@0 | 13 0: Expr_Closure( |
Chris@0 | 14 static: false |
Chris@0 | 15 byRef: false |
Chris@0 | 16 params: array( |
Chris@0 | 17 0: Param( |
Chris@0 | 18 type: null |
Chris@0 | 19 byRef: false |
Chris@0 | 20 variadic: false |
Chris@0 | 21 name: a |
Chris@0 | 22 default: null |
Chris@0 | 23 ) |
Chris@0 | 24 ) |
Chris@0 | 25 uses: array( |
Chris@0 | 26 ) |
Chris@0 | 27 returnType: null |
Chris@0 | 28 stmts: array( |
Chris@0 | 29 0: Expr_Variable( |
Chris@0 | 30 name: a |
Chris@0 | 31 ) |
Chris@0 | 32 ) |
Chris@0 | 33 ) |
Chris@0 | 34 1: Expr_Closure( |
Chris@0 | 35 static: false |
Chris@0 | 36 byRef: false |
Chris@0 | 37 params: array( |
Chris@0 | 38 0: Param( |
Chris@0 | 39 type: null |
Chris@0 | 40 byRef: false |
Chris@0 | 41 variadic: false |
Chris@0 | 42 name: a |
Chris@0 | 43 default: null |
Chris@0 | 44 ) |
Chris@0 | 45 ) |
Chris@0 | 46 uses: array( |
Chris@0 | 47 0: Expr_ClosureUse( |
Chris@0 | 48 var: b |
Chris@0 | 49 byRef: false |
Chris@0 | 50 ) |
Chris@0 | 51 ) |
Chris@0 | 52 returnType: null |
Chris@0 | 53 stmts: array( |
Chris@0 | 54 ) |
Chris@0 | 55 ) |
Chris@0 | 56 2: Expr_Closure( |
Chris@0 | 57 static: false |
Chris@0 | 58 byRef: false |
Chris@0 | 59 params: array( |
Chris@0 | 60 ) |
Chris@0 | 61 uses: array( |
Chris@0 | 62 0: Expr_ClosureUse( |
Chris@0 | 63 var: a |
Chris@0 | 64 byRef: false |
Chris@0 | 65 ) |
Chris@0 | 66 1: Expr_ClosureUse( |
Chris@0 | 67 var: b |
Chris@0 | 68 byRef: true |
Chris@0 | 69 ) |
Chris@0 | 70 ) |
Chris@0 | 71 returnType: null |
Chris@0 | 72 stmts: array( |
Chris@0 | 73 ) |
Chris@0 | 74 ) |
Chris@0 | 75 3: Expr_Closure( |
Chris@0 | 76 static: false |
Chris@0 | 77 byRef: true |
Chris@0 | 78 params: array( |
Chris@0 | 79 0: Param( |
Chris@0 | 80 type: null |
Chris@0 | 81 byRef: false |
Chris@0 | 82 variadic: false |
Chris@0 | 83 name: a |
Chris@0 | 84 default: null |
Chris@0 | 85 ) |
Chris@0 | 86 ) |
Chris@0 | 87 uses: array( |
Chris@0 | 88 ) |
Chris@0 | 89 returnType: null |
Chris@0 | 90 stmts: array( |
Chris@0 | 91 ) |
Chris@0 | 92 ) |
Chris@0 | 93 4: Expr_Closure( |
Chris@0 | 94 static: true |
Chris@0 | 95 byRef: false |
Chris@0 | 96 params: array( |
Chris@0 | 97 ) |
Chris@0 | 98 uses: array( |
Chris@0 | 99 ) |
Chris@0 | 100 returnType: null |
Chris@0 | 101 stmts: array( |
Chris@0 | 102 ) |
Chris@0 | 103 ) |
Chris@0 | 104 5: Expr_Closure( |
Chris@0 | 105 static: false |
Chris@0 | 106 byRef: false |
Chris@0 | 107 params: array( |
Chris@0 | 108 0: Param( |
Chris@0 | 109 type: null |
Chris@0 | 110 byRef: false |
Chris@0 | 111 variadic: false |
Chris@0 | 112 name: a |
Chris@0 | 113 default: null |
Chris@0 | 114 ) |
Chris@0 | 115 ) |
Chris@0 | 116 uses: array( |
Chris@0 | 117 ) |
Chris@0 | 118 returnType: array |
Chris@0 | 119 stmts: array( |
Chris@0 | 120 ) |
Chris@0 | 121 ) |
Chris@0 | 122 6: Expr_Closure( |
Chris@0 | 123 static: false |
Chris@0 | 124 byRef: false |
Chris@0 | 125 params: array( |
Chris@0 | 126 ) |
Chris@0 | 127 uses: array( |
Chris@0 | 128 0: Expr_ClosureUse( |
Chris@0 | 129 var: a |
Chris@0 | 130 byRef: false |
Chris@0 | 131 ) |
Chris@0 | 132 ) |
Chris@0 | 133 returnType: Name_FullyQualified( |
Chris@0 | 134 parts: array( |
Chris@0 | 135 0: Foo |
Chris@0 | 136 1: Bar |
Chris@0 | 137 ) |
Chris@0 | 138 ) |
Chris@0 | 139 stmts: array( |
Chris@0 | 140 ) |
Chris@0 | 141 ) |
Chris@0 | 142 ) |