diff options
| -rw-r--r-- | Zend/tests/closure_with_variadic_typehint.phpt | 15 | ||||
| -rw-r--r-- | ext/opcache/Optimizer/compact_literals.c | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/Zend/tests/closure_with_variadic_typehint.phpt b/Zend/tests/closure_with_variadic_typehint.phpt new file mode 100644 index 0000000000..3e91a6f176 --- /dev/null +++ b/Zend/tests/closure_with_variadic_typehint.phpt @@ -0,0 +1,15 @@ +--TEST-- +Closure with variadic type hint +--FILE-- +<?php +$f = function (stdClass ...$a) { + var_dump($a); +}; +$f(new stdClass); +?> +--EXPECT-- +array(1) { + [0]=> + object(stdClass)#2 (0) { + } +} diff --git a/ext/opcache/Optimizer/compact_literals.c b/ext/opcache/Optimizer/compact_literals.c index 812f24fe8f..50caf4297b 100644 --- a/ext/opcache/Optimizer/compact_literals.c +++ b/ext/opcache/Optimizer/compact_literals.c @@ -295,6 +295,7 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx } break; case ZEND_RECV: + case ZEND_RECV_VARIADIC: case ZEND_VERIFY_RETURN_TYPE: if (opline->op2.num != -1) { opline->op2.num = cache_size; |
