--TEST-- Testing reading and writing to DOMNode::textContent --EXTENSIONS-- dom --SKIPIF-- --FILE-- tag */ $html = <<hi there HTML; $text = '
hello world ™
'; $dom = new DOMDocument('1.0', 'UTF-8'); $dom->loadHTML($html); $node = $dom->getElementById('test'); var_dump($node->textContent); $node->textContent = $text; var_dump($node->textContent == $text); var_dump($dom->saveHTML($node)); ?> --EXPECT-- string(8) "hi there" bool(true) string(63) "