1--TEST--
2Bug #79701 (getElementById does not correctly work with duplicate definitions) - nodeValue / value variation
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7foreach (["value", "nodeValue"] as $property) {
8    echo "--- Testing property \$$property ---\n";
9    $dom = Dom\XMLDocument::createFromString(<<<XML
10    <root>
11        <test1 xml:id="x"/>
12        <test2 xml:id="y"/>
13    </root>
14    XML);
15
16    $test1 = $dom->getElementById('x');
17    $test2 = $dom->getElementById('y');
18
19    var_dump($test1?->nodeName);
20    var_dump($test2?->nodeName);
21
22    $test1->getAttributeNode('xml:id')->$property = "y";
23    var_dump($dom->getElementById('x')?->nodeName);
24    var_dump($dom->getElementById('y')?->nodeName);
25
26    $test2->getAttributeNode('xml:id')->$property = "x";
27    var_dump($dom->getElementById('x')?->nodeName);
28    var_dump($dom->getElementById('y')?->nodeName);
29}
30?>
31--EXPECT--
32--- Testing property $value ---
33string(5) "test1"
34string(5) "test2"
35NULL
36string(5) "test1"
37string(5) "test2"
38string(5) "test1"
39--- Testing property $nodeValue ---
40string(5) "test1"
41string(5) "test2"
42NULL
43string(5) "test1"
44string(5) "test2"
45string(5) "test1"
46