mirror of
https://github.com/php/php-src.git
synced 2024-11-28 04:14:26 +08:00
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: Add regression test for GH-11682
This commit is contained in:
commit
3552a1be97
27
ext/dom/tests/gh11682.phpt
Normal file
27
ext/dom/tests/gh11682.phpt
Normal file
@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Fix GH-11682 (Consecutive calls to DOMNode::before and DOMNode::remove unlink wrong nodes)
|
||||
--EXTENSIONS--
|
||||
dom
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$dom = new DOMDocument;
|
||||
$dom->loadXML('<?xml version="1.0" ?><root><node /></root>');
|
||||
|
||||
$list = [
|
||||
$dom->createElement('foo1'),
|
||||
$dom->createElement('foo2'),
|
||||
$dom->createElement('foo3')
|
||||
];
|
||||
|
||||
$node = $dom->getElementsByTagName('node')->item(0);
|
||||
|
||||
$node->before(...$list);
|
||||
$node->remove();
|
||||
|
||||
echo $dom->saveXML();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
<?xml version="1.0"?>
|
||||
<root><foo1/><foo2/><foo3/></root>
|
Loading…
Reference in New Issue
Block a user