Annotation of embedaddon/php/ext/simplexml/tests/bug42369.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #42369 (Implicit conversion to string leaks memory)
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded('simplexml')) echo 'skip simplexml extension is not loaded'; ?>
! 5: --FILE--
! 6: <?php
! 7: $xml = '<?xml version="1.0" encoding="utf-8"?>';
! 8: $x = simplexml_load_string($xml . "<q><x>foo</x></q>");
! 9:
! 10: echo 'explicit conversion' . PHP_EOL;
! 11: for ($i = 0; $i < 100000; $i++) {
! 12: md5(strval($x->x));
! 13: }
! 14:
! 15: echo 'no conversion' . PHP_EOL;
! 16: for ($i = 0; $i < 100000; $i++) {
! 17: md5($x->x);
! 18: }
! 19:
! 20: ?>
! 21: ===DONE===
! 22: --EXPECT--
! 23: explicit conversion
! 24: no conversion
! 25: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>