xref: /PHP-5.4/ext/xmlrpc/tests/bug45556.phpt (revision f38bfa62)
1--TEST--
2Bug #45556 (Return value from callback isn't freed)
3--SKIPIF--
4<?php if (!extension_loaded("xmlrpc")) print "skip"; ?>
5--FILE--
6<?php
7
8$options = array ();
9$request = xmlrpc_encode_request ("system.describeMethods", $options);
10$server = xmlrpc_server_create ();
11
12
13function foo() { return 11111; }
14
15class bar {
16	static public function test() {
17		return 'foo';
18	}
19}
20
21xmlrpc_server_register_introspection_callback($server, 'foobar');
22xmlrpc_server_register_introspection_callback($server, array('bar', 'test'));
23xmlrpc_server_register_introspection_callback($server, array('foo', 'bar'));
24
25$options = array ('output_type' => 'xml', 'version' => 'xmlrpc');
26xmlrpc_server_call_method ($server, $request, NULL, $options);
27
28?>
29--EXPECTF--
30Warning: xmlrpc_server_call_method(): Invalid callback 'foobar' passed in %s on line %d
31
32Warning: xmlrpc_server_call_method(): xml parse error: [line 1, column 1, message: Invalid document end] Unable to add introspection data returned from bar::test() in %s on line %d
33
34Warning: xmlrpc_server_call_method(): Invalid callback 'foo::bar' passed in %s on line %d
35