xref: /PHP-7.4/ext/simplexml/tests/bug76712.phpt (revision 692e5d5c)
1--TEST--
2BUg #76712 (Assignment of empty string creates extraneous text node)
3--SKIPIF--
4<?php
5if (!extension_loaded('simplexml')) die('skip simplexml not available');
6?>
7--FILE--
8<?php
9$sxe = new SimpleXMLElement('<foo></foo>');
10$sxe->addChild('bar', '');
11echo $sxe->asXML();
12
13$sxe = new SimpleXMLElement('<foo></foo>');
14$sxe->addChild('bar');
15$sxe->bar = '';
16echo $sxe->asXML();
17?>
18===DONE===
19--EXPECT--
20<?xml version="1.0"?>
21<foo><bar/></foo>
22<?xml version="1.0"?>
23<foo><bar/></foo>
24===DONE===
25