Annotation of embedaddon/php/ext/simplexml/tests/bug35785.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #35785 (SimpleXML memory read error)
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded("simplexml")) print "skip"; ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: $xml = simplexml_load_string("<root></root>");
! 9: $xml->bla->posts->name = "FooBar";
! 10: echo $xml->asXML();
! 11: $xml = simplexml_load_string("<root></root>");
! 12: $count = count($xml->bla->posts);
! 13: var_dump($count);
! 14: $xml->bla->posts[$count]->name = "FooBar";
! 15: echo $xml->asXML();
! 16: $xml = simplexml_load_string("<root></root>");
! 17: $xml->bla->posts[]->name = "FooBar";
! 18: echo $xml->asXML();
! 19: ?>
! 20: ===DONE===
! 21: <?php exit(0); __halt_compiler(); ?>
! 22: --EXPECTF--
! 23: <?xml version="1.0"?>
! 24: <root><bla><posts><name>FooBar</name></posts></bla></root>
! 25: int(0)
! 26: <?xml version="1.0"?>
! 27: <root><bla><posts><name>FooBar</name></posts></bla></root>
! 28: <?xml version="1.0"?>
! 29: <root><bla><posts><name>FooBar</name></posts></bla></root>
! 30: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>