xref: /PHP-8.2/ext/dom/tests/bug80602_4.phpt (revision bffc7447)
1--TEST--
2Bug #80602 (Segfault when using DOMChildNode::before()) - after text merge variation
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$doc = new \DOMDocument();
9$doc->loadXML('<a>foo<last/>bar</a>');
10$foo = $doc->firstChild->firstChild;
11$bar = $doc->firstChild->lastChild;
12
13$foo->after($bar);
14
15var_dump($doc->saveXML());
16
17$foo->nodeValue = "x";
18
19var_dump($doc->saveXML());
20
21$bar->nodeValue = "y";
22
23var_dump($doc->saveXML());
24
25?>
26--EXPECT--
27string(43) "<?xml version="1.0"?>
28<a>foobar<last/></a>
29"
30string(41) "<?xml version="1.0"?>
31<a>xbar<last/></a>
32"
33string(39) "<?xml version="1.0"?>
34<a>xy<last/></a>
35"
36