Annotation of embedaddon/php/ext/simplexml/tests/bug37386.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #39760 (autocreating element doesn't assign value to first node)
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded("simplexml")) print "skip simplexml extension is not loaded"; ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: $sx1 = new SimpleXMLElement((binary)"<root />");
! 9:
! 10: $sx1->node[0] = 'node1';
! 11: $sx1->node[1] = 'node2';
! 12:
! 13: print $sx1->asXML()."\n";
! 14: $node = $sx1->node[0];
! 15: $node[0] = 'New Value';
! 16:
! 17: print $sx1->asXML();
! 18:
! 19: ?>
! 20: --EXPECTF--
! 21: <?xml version="1.0"?>
! 22: <root><node>node1</node><node>node2</node></root>
! 23:
! 24: <?xml version="1.0"?>
! 25: <root><node>New Value</node><node>node2</node></root>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>