xref: /PHP-7.2/ext/simplexml/tests/bug37386.phpt (revision 617dcf1b)
1--TEST--
2Bug #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("<root />");
9
10$sx1->node[0] = 'node1';
11$sx1->node[1] = 'node2';
12
13print $sx1->asXML()."\n";
14$node = $sx1->node[0];
15$node[0] = 'New Value';
16
17print $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>
26