xref: /PHP-7.3/ext/simplexml/tests/bug41582.phpt (revision cfc417af)
1--TEST--
2Bug #41582 (SimpleXML crashes when accessing newly created element)
3--SKIPIF--
4<?php if (!extension_loaded("simplexml")) print "skip"; ?>
5--FILE--
6<?php
7
8$xml = new SimpleXMLElement('<?xml version="1.0" standalone="yes"?>
9<collection></collection>');
10
11$xml->movie[]->characters->character[0]->name = 'Miss Coder';
12
13echo($xml->asXml());
14
15?>
16===DONE===
17--EXPECT--
18<?xml version="1.0" standalone="yes"?>
19<collection><movie><characters><character><name>Miss Coder</name></character></characters></movie></collection>
20===DONE===
21