3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dom = new DOMDocument(); $div = $dom->createElement('div'); $h4 = $dom->createElement('h4'); $span = $dom->createElement('span'); $foo = new DomText('foo'); $bar = new DomText('bar'); $span->appendChild($foo); $h4->appendChild($span); $h4->appendChild($bar); $div->appendChild($h4); $dom->appendChild($div); echo $dom->saveHTML(); echo "\n=============\n"; $h4_tags=$div->getElementsByTagName('h4'); $text=$h4_tags->items()->firstChild->textContent; echo $text;
Output for git.master, git.master_jit, rfc.property-hooks
<div><h4><span>foo</span>bar</h4></div> ============= Fatal error: Uncaught Error: Call to undefined method DOMNodeList::items() in /in/uFhMR:18 Stack trace: #0 {main} thrown in /in/uFhMR on line 18
Process exited with code 255.

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