xref: /PHP-8.4/ext/simplexml/tests/bug41582.phpt (revision 7f2f0c00)
1--TEST--
2Bug #41582 (SimpleXML crashes when accessing newly created element)
3--EXTENSIONS--
4simplexml
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--EXPECT--
17<?xml version="1.0" standalone="yes"?>
18<collection><movie><characters><character><name>Miss Coder</name></character></characters></movie></collection>
19