xref: /PHP-5.3/ext/wddx/tests/bug48562.phpt (revision 07fae45e)
1--TEST--
2Bug #48562 (Reference recursion causes segfault when used in wddx_serialize_vars())
3--SKIPIF--
4<?php
5if (!extension_loaded('wddx')) {
6    die('skip. wddx not available');
7}
8?>
9--FILE--
10<?php
11
12$foo = 'bar';
13
14$a['x'] = 'foo';
15$a['x'] = &$a;
16
17var_dump(wddx_serialize_vars($a));
18
19$a['x'] = 'foo';
20$a['x'] = $a;
21
22var_dump(wddx_serialize_vars($a));
23
24?>
25--EXPECTF--
26Warning: wddx_serialize_vars(): recursion detected in %s on line %d
27string(78) "<wddxPacket version='1.0'><header/><data><struct></struct></data></wddxPacket>"
28string(120) "<wddxPacket version='1.0'><header/><data><struct><var name='foo'><string>bar</string></var></struct></data></wddxPacket>"
29