We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 69a5c56 commit 4cf8b6fCopy full SHA for 4cf8b6f
Zend/tests/closure_use_trailing_comma.phpt
@@ -0,0 +1,17 @@
1
+--TEST--
2
+Closure use list can have trailing commas
3
+--FILE--
4
+<?php
5
+
6
+$b = 'test';
7
+$fn = function () use (
8
+ $b,
9
+ &$a,
10
+) {
11
+ $a = $b;
12
+};
13
+$fn();
14
+echo "$a\n";
15
+?>
16
+--EXPECT--
17
+test
Zend/zend_language_parser.y
@@ -1155,7 +1155,7 @@ returns_ref:
1155
1156
lexical_vars:
1157
%empty { $$ = NULL; }
1158
- | T_USE '(' lexical_var_list ')' { $$ = $3; }
+ | T_USE '(' lexical_var_list possible_comma ')' { $$ = $3; }
1159
;
1160
1161
lexical_var_list:
0 commit comments