File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Closure::__invoke() with variadic parameter
3
+ --FILE--
4
+ <?php
5
+
6
+ $ closure = function (&...$ refs ) {};
7
+ $ closure ->__invoke (
8
+ $ v1 , $ v2 , $ v3 , $ v4 ,
9
+ $ v5 , $ v6 , $ v7 , $ v8 ,
10
+ $ v9 , $ v10 , $ v11 , $ v12 ,
11
+ $ v13
12
+ );
13
+
14
+ ?>
15
+ ===DONE===
16
+ --EXPECT--
17
+ ===DONE===
Original file line number Diff line number Diff line change @@ -148,10 +148,12 @@ ZEND_API zend_function *zend_get_closure_invoke_method(zval *obj TSRMLS_DC) /* {
148
148
{
149
149
zend_closure * closure = (zend_closure * )zend_object_store_get_object (obj TSRMLS_CC );
150
150
zend_function * invoke = (zend_function * )emalloc (sizeof (zend_function ));
151
+ const zend_uint keep_flags = ZEND_ACC_RETURN_REFERENCE | ZEND_ACC_VARIADIC ;
151
152
152
153
invoke -> common = closure -> func .common ;
153
154
invoke -> type = ZEND_INTERNAL_FUNCTION ;
154
- invoke -> internal_function .fn_flags = ZEND_ACC_PUBLIC | ZEND_ACC_CALL_VIA_HANDLER | (closure -> func .common .fn_flags & ZEND_ACC_RETURN_REFERENCE );
155
+ invoke -> internal_function .fn_flags =
156
+ ZEND_ACC_PUBLIC | ZEND_ACC_CALL_VIA_HANDLER | (closure -> func .common .fn_flags & keep_flags );
155
157
invoke -> internal_function .handler = ZEND_MN (Closure___invoke );
156
158
invoke -> internal_function .module = 0 ;
157
159
invoke -> internal_function .scope = zend_ce_closure ;
You can’t perform that action at this time.
0 commit comments