1--TEST-- 2Manually call __construct() - element variation 3--EXTENSIONS-- 4dom 5--FILE-- 6<?php 7 8$element = new DOMElement('foo', 'my value'); 9var_dump($element->nodeName, $element->textContent); 10$element->__construct('foo2', 'my new value'); 11var_dump($element->nodeName, $element->textContent); 12 13$doc = new DOMDocument(); 14$doc->loadXML(<<<XML 15<?xml version="1.0"?> 16<container/> 17XML); 18$doc->documentElement->appendChild($element); 19echo $doc->saveXML(); 20 21$element->__construct('foo3', 'my new new value'); 22$doc->documentElement->appendChild($element); 23echo $doc->saveXML(); 24 25?> 26--EXPECT-- 27string(3) "foo" 28string(8) "my value" 29string(4) "foo2" 30string(12) "my new value" 31<?xml version="1.0"?> 32<container><foo2>my new value</foo2></container> 33<?xml version="1.0"?> 34<container><foo2>my new value</foo2><foo3>my new new value</foo3></container> 35