diff options
author | Anatol Belski <ab@php.net> | 2018-05-28 17:13:55 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2018-05-28 17:13:55 +0200 |
commit | d5ee654b7113c4123a5f2d4628016d31dbced2d4 (patch) | |
tree | 36edc329afe53165db26cefdc4ac69496cd6d9a9 | |
parent | 4455899a938167ea8617e71dd5f19e92dcc8ab0c (diff) | |
parent | 5bf8032112016c2f60149d05d20c8756a6e2664a (diff) | |
download | php-git-d5ee654b7113c4123a5f2d4628016d31dbced2d4.tar.gz |
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
Translate correct C++ version with suitable compiler
Fixed bug #76383 (array_map on $GLOBALS returns IS_INDIRECT)
-rw-r--r-- | Zend/tests/bug76383.phpt | 13 | ||||
-rw-r--r-- | ext/standard/array.c | 2 | ||||
-rw-r--r-- | win32/build/confutils.js | 4 |
3 files changed, 18 insertions, 1 deletions
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-- +<?php + +$a = 1; +array_map(function($x) use (&$lastval) { $lastval = $x; }, $GLOBALS); +var_dump(gettype($lastval), $lastval); // will contain $a + +?> +--EXPECT-- +string(7) "integer" +int(1) diff --git a/ext/standard/array.c b/ext/standard/array.c index 6e68010f90..0a9cfb30cb 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -6080,7 +6080,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; diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 486f5ee147..1c00543bb6 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -3137,6 +3137,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'); |