3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <div id="test"><span>hi there</span></div> HTML; $text = '<p>hello world &trade;</p>'; $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));
Output for git.master, git.master_jit, rfc.property-hooks
string(8) "hi there" bool(true) string(63) "<div id="test">&lt;p&gt;hello world &amp;trade;&lt;/p&gt;</div>"

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
56.72 ms | 401 KiB | 8 Q