From 97a84831432a9b727235ee4727905919681aeac4 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Mon, 28 May 2018 00:48:35 +0200 Subject: Fixed bug #76383 (array_map on $GLOBALS returns IS_INDIRECT) --- NEWS | 1 + Zend/tests/bug76383.phpt | 13 +++++++++++++ ext/standard/array.c | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 Zend/tests/bug76383.phpt diff --git a/NEWS b/NEWS index 695f69346a..339353dc5e 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,7 @@ PHP NEWS - Standard: . Fixed bug #76335 ("link(): Bad file descriptor" with non-ASCII path). (Anatol) + . Fixed bug #76383 (array_map on $GLOBALS returns IS_INDIRECT). (Bob) 24 May 2018, PHP 7.1.18 diff --git a/Zend/tests/bug76383.phpt b/Zend/tests/bug76383.phpt new file mode 100644 index 0000000000..ae26ba8acd --- /dev/null +++ b/Zend/tests/bug76383.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #76383: array_map on $GLOBALS returns IS_INDIRECT +--FILE-- + +--EXPECT-- +string(7) "integer" +int(1) diff --git a/ext/standard/array.c b/ext/standard/array.c index 970735cf47..5905ae4929 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -5348,7 +5348,7 @@ PHP_FUNCTION(array_map) array_init_size(return_value, maxlen); - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL(arrays[0]), num_key, str_key, zv) { + ZEND_HASH_FOREACH_KEY_VAL_IND(Z_ARRVAL(arrays[0]), num_key, str_key, zv) { fci.retval = &result; fci.param_count = 1; fci.params = &arg; -- cgit v1.2.1 From 5bf8032112016c2f60149d05d20c8756a6e2664a Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 28 May 2018 17:12:06 +0200 Subject: Translate correct C++ version with suitable compiler --- win32/build/confutils.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 99a2521301..b33600ce3f 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -3104,6 +3104,10 @@ function toolset_setup_common_cflags() } } + if (VCVERS >= 1914) { + /* This is only in effect for CXX sources, __cplusplus is not defined in C sources. */ + ADD_FLAG("CFLAGS", "/Zc:__cplusplus"); + } } else if (CLANG_TOOLSET) { if (X64) { ADD_FLAG('CFLAGS', '-m64'); -- cgit v1.2.1