3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument; $doc->loadHTML('<html><body id="x"><div id="y"></div></body></html>'); $body = $doc->getElementById('x'); $div = $doc->getElementById('y'); $node = (new DOMXPath($doc))->query('.//*[@id="y"]', $doc->documentElement)->item(0); echo '0: ' . ( $node ? $node->tagName : 'null' ) . PHP_EOL; $body->removeChild($div); $node = (new DOMXPath($doc))->query('.//*[@id="y"]', $doc->documentElement)->item(0); echo '1: ' . ( $node ? $node->tagName : 'null' ) . PHP_EOL;
Output for git.master, git.master_jit, rfc.property-hooks
0: div 1: null

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:
60.67 ms | 401 KiB | 8 Q