Skip to content

Commit

Permalink
Merge branch 'PHP-7.0' into PHP-7.1
Browse files Browse the repository at this point in the history
* PHP-7.0:
  Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing array elements)
  • Loading branch information
laruence committed Jul 22, 2016
2 parents a6953e7 + 5168373 commit df358a1
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
36 changes: 36 additions & 0 deletions ext/xmlrpc/tests/bug72647.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
--TEST--
Bug #72647 (xmlrpc_encode() unexpected output after referencing array elements)
--SKIPIF--
<?php
if (!extension_loaded("xmlrpc")) print "skip";
?>
--FILE--
<?php

$ar = array(4, "a", 7);
$v = &$ar[1];
unset($v);

echo xmlrpc_encode($ar);
?>
--EXPECTF--
<?xml version="1.0" encoding="utf-8"?>
<params>
<param>
<value>
<array>
<data>
<value>
<int>4</int>
</value>
<value>
<string>a</string>
</value>
<value>
<int>7</int>
</value>
</data>
</array>
</value>
</param>
</params>
1 change: 1 addition & 0 deletions ext/xmlrpc/xmlrpc-epi-php.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int dep
xReturn = XMLRPC_CreateVector(key, vtype);

ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL(val_arr), num_index, my_key, pIter) {
ZVAL_DEREF(pIter);
ht = HASH_OF(pIter);
if (ht) {
ht->u.v.nApplyCount++;
Expand Down

0 comments on commit df358a1

Please sign in to comment.