mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00

Previously, when replacing the node with itself (or contained within itself), the node disappeared. Closes GH-11770.
15 lines
363 B
PHP
15 lines
363 B
PHP
--TEST--
|
|
DOMCharacterData::replaceWith() with itself
|
|
--EXTENSIONS--
|
|
dom
|
|
--FILE--
|
|
<?php
|
|
$dom = new DOMDocument;
|
|
$dom->loadXML('<?xml version="1.0"?><container><![CDATA[Hello]]></container>');
|
|
$cdata = $dom->documentElement->firstChild;
|
|
$cdata->replaceWith($cdata);
|
|
echo $dom->saveXML();
|
|
?>
|
|
--EXPECT--
|
|
<?xml version="1.0"?>
|
|
<container><![CDATA[Hello]]></container>
|