diff --git a/NEWS b/NEWS index 36b01a34533..37daabe74a3 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,10 @@ PHP NEWS - mbstring: . Fixed bug #66797 (mb_substr only takes 32-bit signed integer). (cmb) +- SOAP: + . Fixed bug #71996 (Using references in arrays doesn't work like expected). + (Nikita) + - Standard: . Fixed bug #71882 (Negative ftruncate() on php://memory exhausts memory). (cmb) diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index fc389f2365e..9c9e4e9e560 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -2120,6 +2120,7 @@ static void add_xml_array_elements(xmlNodePtr xmlParam, if (j >= dims[0]) { break; } + ZVAL_DEREF(zdata); if (dimension == 1) { if (enc == NULL) { xparam = master_to_xml(get_conversion(Z_TYPE_P(zdata)), zdata, style, xmlParam); diff --git a/ext/soap/tests/bug71996.phpt b/ext/soap/tests/bug71996.phpt new file mode 100644 index 00000000000..c4bb092b22b --- /dev/null +++ b/ext/soap/tests/bug71996.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #71996: Using references in arrays doesn't work like expected +--SKIPIF-- + +--FILE-- + '', 'uri' => 'http://example.org']) extends SoapClient { + public function __doRequest($request, $location, $action, $version, $one_way = 0) { + echo $request; + return ''; + } +}; +$ref = array("foo"); +$data = array(&$ref); +$client->foo($data); + +?> +--EXPECT-- + +foo