xref: /PHP-8.0/ext/dom/tests/bug81433.phpt (revision 424c2654)
1--TEST--
2Bug #81433 (DOMElement::setIdAttribute(attr, true) called twice removes ID)
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6?>
7--FILE--
8<?php
9$dom = new DOMDocument('1.0', 'utf-8');
10
11$element = $dom->createElement('test', 'root');
12
13$dom->appendChild($element);
14
15$element->setAttribute("id", 123);
16$element->setIdAttribute("id", true);
17
18$node = $element->getAttributeNode("id");
19var_dump($node->isId());
20
21$element->setIdAttribute("id", true);
22var_dump($node->isId());
23?>
24--EXPECT--
25bool(true)
26bool(true)
27