1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.2'

* PHP-8.2:
  Add regression test for GH-11682
This commit is contained in:
Niels Dossche
2023-07-11 23:07:27 +02:00

View 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>