3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = new DOMDocument('1.0', 'iso-8859-1'); $ul = new DomElement('ul'); $html->appendChild($ul); $friends = [ ['firstname' => 'A', 'lastname' => '1',], ['firstname' => 'B', 'lastname' => '2',], ['firstname' => 'C', 'lastname' => '3',], ]; foreach ($friends as $person) { $li = new DomElement('li', $person['firstname'] . ',' . $person['lastname']); $li->setAttribute('class', 'personLi'); $ul->appendChild($li); } echo $html->saveXML();
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught DOMException: No Modification Allowed Error in /in/Kr55t:16 Stack trace: #0 /in/Kr55t(16): DOMElement->setAttribute('class', 'personLi') #1 {main} thrown in /in/Kr55t on line 16
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:
49.59 ms | 401 KiB | 8 Q