From: Xinchen Hui Date: Thu, 17 Dec 2015 06:27:33 +0000 (+0800) Subject: Fixed bug #71127 (Define in auto_prepend_file is overwrite) X-Git-Tag: php-7.0.2RC1~11^2~16^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=940c68b55d4241f9f34d4f71064f5f12a44e8d3d;p=php Fixed bug #71127 (Define in auto_prepend_file is overwrite) --- diff --git a/NEWS b/NEWS index 99ec4682d3..5f8c1c0cfc 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ PHP NEWS (abrender at elitehosts dot com) - Opcache: + . Fixed bug #71127 (Define in auto_prepend_file is overwrite). (Laruence) . Fixed bug #71024 (Unable to use PHP 7.0 x64 side-by-side with PHP 5.6 x32 on the same server). (Anatol) diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c index 1302e4b182..f252117de7 100644 --- a/ext/opcache/Optimizer/pass1_5.c +++ b/ext/opcache/Optimizer/pass1_5.c @@ -16,7 +16,9 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { int i = 0; zend_op *opline = op_array->opcodes; zend_op *end = opline + op_array->last; - zend_bool collect_constants = (op_array == &script->main_op_array); + /* bug #71127* + zend_bool collect_constants = (op_array == &script->main_op_array); */ + zend_bool collect_constants = 0; while (opline < end) { switch (opline->opcode) { diff --git a/ext/opcache/tests/bug71127.phpt b/ext/opcache/tests/bug71127.phpt new file mode 100644 index 0000000000..78c5535062 --- /dev/null +++ b/ext/opcache/tests/bug71127.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #71127 (Define in auto_prepend_file is overwrite) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +--SKIPIF-- + +--FILE-- +"); + +define("FOO", "okey"); + +include($file); +?> +--CLEAN-- + +--EXPECTF-- +Notice: Constant FOO already defined in %sbug71127.inc on line %d +okey