mirror of
https://github.com/php/php-src.git
synced 2025-08-17 14:38:49 +02:00
27 lines
487 B
PHP
27 lines
487 B
PHP
--TEST--
|
|
DOMNode::replaceWith()
|
|
--SKIPIF--
|
|
<?php require_once('skipif.inc'); ?>
|
|
--FILE--
|
|
<?php
|
|
require_once("dom_test.inc");
|
|
|
|
$dom = new DOMDocument;
|
|
$dom->loadXML('<test><mark>first</mark><mark>second</mark></test>');
|
|
|
|
$element = $dom->documentElement->firstChild;
|
|
$element->replaceWith(
|
|
$dom->createElement('element', 'content'),
|
|
'content'
|
|
);
|
|
|
|
print_node_list_compact($dom->documentElement->childNodes);
|
|
?>
|
|
--EXPECT--
|
|
<element>
|
|
content
|
|
</element>
|
|
content
|
|
<mark>
|
|
second
|
|
</mark>
|