mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00
Fixed bug #69159 (Opcache causes problem when passing a variable variable to a function)
This commit is contained in:
parent
6183408031
commit
a29b64fc10
3 changed files with 24 additions and 2 deletions
2
NEWS
2
NEWS
|
@ -25,6 +25,8 @@
|
|||
. Fixed bug #68964 (Allowed memory size exhausted with odbc_exec). (Anatol)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #69159 (Opcache causes problem when passing a variable variable
|
||||
to a function). (Dmitry, Laruence)
|
||||
. Fixed bug #69125 (Array numeric string as key). (Laruence)
|
||||
. Fixed bug #69038 (switch(SOMECONSTANT) misbehaves). (Laruence)
|
||||
|
||||
|
|
|
@ -82,10 +82,10 @@ static void optimize_func_calls(zend_op_array *op_array, zend_persistent_script
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
|
20
ext/opcache/tests/bug69159.phpt
Normal file
20
ext/opcache/tests/bug69159.phpt
Normal file
|
@ -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"
|
Loading…
Add table
Add a link
Reference in a new issue