xref: /PHP-7.4/ext/xmlrpc/tests/bug74975.phpt (revision 782352c5)
1--TEST--
2Bug #74975	Different serialization for classes
3--SKIPIF--
4<?php
5if (!extension_loaded("xmlrpc")) print "skip";
6?>
7--FILE--
8<?php
9
10class Foo {
11
12}
13
14class Bar {
15
16    public $xmlrpc_type;
17    public $scalar;
18
19}
20
21$foo = new Foo();
22$foo->xmlrpc_type = 'base64';
23$foo->scalar = 'foobar';
24
25$bar = new Bar();
26$bar->xmlrpc_type = 'base64';
27$bar->scalar = 'foobar';
28
29echo xmlrpc_encode([
30    'foo' => $foo,
31    'bar' => $bar
32]);
33
34?>
35--EXPECT--
36<?xml version="1.0" encoding="utf-8"?>
37<params>
38<param>
39 <value>
40  <struct>
41   <member>
42    <name>foo</name>
43    <value>
44     <base64>Zm9vYmFy&#10;</base64>
45    </value>
46   </member>
47   <member>
48    <name>bar</name>
49    <value>
50     <base64>Zm9vYmFy&#10;</base64>
51    </value>
52   </member>
53  </struct>
54 </value>
55</param>
56</params>
57