com php-src: Fix RECV_VARIADIC literal compacting wrt cache slot: Zend/tests/closure_with_variadic_typ ehint.phpt
ext/opcache/Optimizer/compact_literals.c

From: Date: Sun, 26 Jul 2015 19:22:31 +0000
Subject: com php-src: Fix RECV_VARIADIC literal compacting wrt cache slot: Zend/tests/closure_with_variadic_typ ehint.phpt
ext/opcache/Optimizer/compact_literals.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-88166@lists.php.net to get a copy of this message
Commit: a717acd21a0cd9c4d41c6dfbb536399e9258824d Author: Nikita Popov <nikic@php.net> Sun, 26 Jul 2015 21:22:31 +0200 Parents: 27c973a954375a3706d4a1685334444713e14af8 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a717acd21a0cd9c4d41c6dfbb536399e9258824d Log: Fix RECV_VARIADIC literal compacting wrt cache slot Changed paths: A Zend/tests/closure_with_variadic_typehint.phpt M ext/opcache/Optimizer/compact_literals.c Diff: diff --git a/Zend/tests/closure_with_variadic_typehint.phpt b/Zend/tests/closure_with_variadic_typehint.phpt new file mode 100644 index 0000000..3e91a6f --- /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 812f24f..50caf42 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;

« previous php.cvs (#88166) next »