3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument; $xpath = new DOMXPath($doc); $frag = $doc->createDocumentFragment(); $frag->appendXML(<<<'HTML' <div id="article"> <p>Some text</p> <p>More text</p> <pre><code> echo $variable; </code></pre> </div> HTML ); $text_nodes = $xpath->query('descendant::text()[not(ancestor::pre)]', $frag); foreach ($text_nodes as $text_node) { $text_node->data = strrev($text_node->data); } echo $doc->saveHTML($frag->firstChild);
Output for git.master, git.master_jit, rfc.property-hooks
<div id="article"> <p>txet emoS</p> <p>txet eroM</p> <pre><code> echo $variable; </code></pre> </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:
47.31 ms | 401 KiB | 8 Q