Description
Description
The following code:
<?php
$document = new DOMDocument();
$document->loadXML('<element attribute="value"/>');
$attribute = $document->documentElement->getAttributeNode('attribute');
// output loaded attribute value
var_dump($attribute->textContent);
// change value
$attribute->textContent = 'new value';
// output changed value
var_dump($attribute->textContent);
Resulted in this output:
string(5) "value"
string(0) ""
But I expected this output instead:
string(5) "value"
string(9) "new value"
This work in PHP Versions 5.6.1 to 5.6.13, it is broken for any PHP version after that.
PHP Version
PHP 8.2.1
Operating System
No response