xref: /PHP-8.3/ext/simplexml/tests/bug76712.phpt (revision 7f2f0c00)
1--TEST--
2BUg #76712 (Assignment of empty string creates extraneous text node)
3--EXTENSIONS--
4simplexml
5--FILE--
6<?php
7$sxe = new SimpleXMLElement('<foo></foo>');
8$sxe->addChild('bar', '');
9echo $sxe->asXML();
10
11$sxe = new SimpleXMLElement('<foo></foo>');
12$sxe->addChild('bar');
13$sxe->bar = '';
14echo $sxe->asXML();
15?>
16--EXPECT--
17<?xml version="1.0"?>
18<foo><bar/></foo>
19<?xml version="1.0"?>
20<foo><bar/></foo>
21