diff options
author | Xinchen Hui <laruence@php.net> | 2015-03-04 14:49:03 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2015-03-04 14:49:03 +0800 |
commit | ec00a4de4e8db83c07afde9a182d43fe73d860c9 (patch) | |
tree | bc47ae95e0ed21dd476c17f239abb03754b7797e | |
parent | fffd173b7ad6fb4d5977b000d1820537511cdd53 (diff) | |
parent | a29b64fc1029b4121e3e9ff20901c35ad600b4da (diff) | |
download | php-git-ec00a4de4e8db83c07afde9a182d43fe73d860c9.tar.gz |
Merge branch 'PHP-5.6'
-rw-r--r-- | ext/opcache/Optimizer/optimize_func_calls.c | 4 | ||||
-rw-r--r-- | ext/opcache/tests/bug69159.phpt | 20 |
2 files changed, 22 insertions, 2 deletions
diff --git a/ext/opcache/Optimizer/optimize_func_calls.c b/ext/opcache/Optimizer/optimize_func_calls.c index 270e38d594..c82df24c58 100644 --- a/ext/opcache/Optimizer/optimize_func_calls.c +++ b/ext/opcache/Optimizer/optimize_func_calls.c @@ -109,10 +109,10 @@ void optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx) case ZEND_FETCH_DIM_FUNC_ARG: if (call_stack[call - 1].func) { if (ARG_SHOULD_BE_SENT_BY_REF(call_stack[call - 1].func, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - opline->extended_value = 0; + opline->extended_value &= ZEND_FETCH_TYPE_MASK; opline->opcode -= 9; } else { - opline->extended_value = 0; + opline->extended_value &= ZEND_FETCH_TYPE_MASK; opline->opcode -= 12; } } diff --git a/ext/opcache/tests/bug69159.phpt b/ext/opcache/tests/bug69159.phpt new file mode 100644 index 0000000000..d8b953a1aa --- /dev/null +++ b/ext/opcache/tests/bug69159.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #69159 (Opcache causes problem when passing a variable variable to a function) +--INI-- +opcache.enable=1 +opcache.optimization_level=-1 +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php +$i = 1; +$x1 = "okey"; +myFunction(${"x$i"}); + +function myFunction($x) { + var_dump($x); +} + +?> +--EXPECT-- +string(4) "okey" |