3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = new DOMDocument('1.0', 'iso-8859-1'); $ul = $html->createElement('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['firstname']); $ul->appendChild($li); } //for person in friends { // $PersonLi = $myUl.newLi("personLi" . array_search(person,friends)); // $PersonLI->text = person.firstname .",". person.lastname; // } echo $html->saveXML();
Output for git.master, git.master_jit, rfc.property-hooks
<?xml version="1.0" encoding="iso-8859-1"?> <ul><li>A,A</li><li>B,B</li><li>C,C</li></ul>

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