xref: /PHP-8.0/ext/simplexml/tests/bug76712.phpt (revision a555cc0b)
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--EXPECT--
19<?xml version="1.0"?>
20<foo><bar/></foo>
21<?xml version="1.0"?>
22<foo><bar/></foo>
23