mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
692e5d5c88
We work around this peculiarity of libxml by using xmlNodeSetContent(), which does not exhibit this behavior. This also saves us from manually calculating the string length.
25 lines
497 B
PHP
25 lines
497 B
PHP
--TEST--
|
|
BUg #76712 (Assignment of empty string creates extraneous text node)
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('simplexml')) die('skip simplexml not available');
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
$sxe = new SimpleXMLElement('<foo></foo>');
|
|
$sxe->addChild('bar', '');
|
|
echo $sxe->asXML();
|
|
|
|
$sxe = new SimpleXMLElement('<foo></foo>');
|
|
$sxe->addChild('bar');
|
|
$sxe->bar = '';
|
|
echo $sxe->asXML();
|
|
?>
|
|
===DONE===
|
|
--EXPECT--
|
|
<?xml version="1.0"?>
|
|
<foo><bar/></foo>
|
|
<?xml version="1.0"?>
|
|
<foo><bar/></foo>
|
|
===DONE===
|