Annotation of embedaddon/php/ext/wddx/tests/bug48562.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #48562 (Reference recursion causes segfault when used in wddx_serialize_vars())
! 3: --SKIPIF--
! 4: <?php
! 5: if (!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:
! 17: var_dump(wddx_serialize_vars($a));
! 18:
! 19: $a['x'] = 'foo';
! 20: $a['x'] = $a;
! 21:
! 22: var_dump(wddx_serialize_vars($a));
! 23:
! 24: ?>
! 25: --EXPECTF--
! 26: Warning: wddx_serialize_vars(): recursion detected in %s on line %d
! 27: string(78) "<wddxPacket version='1.0'><header/><data><struct></struct></data></wddxPacket>"
! 28: string(120) "<wddxPacket version='1.0'><header/><data><struct><var name='foo'><string>bar</string></var></struct></data></wddxPacket>"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>