3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DomDocument('1.0', 'UTF-8'); $doc->formatOutput = true; $iterator = new ArrayIterator(array( array('john', 'doe', 'john.doe@example.com'), array('jane', 'doe', 'jane.doe@example.com'), )); $root = $doc->createElement('table'); foreach ($iterator as $row) { $item = $doc->createElement('tr'); array_walk($row, function ($value) use (&$item, $doc) { $content = $doc->createTextNode($value); $cell = $doc->createElement('td'); $cell->appendChild($content); $item->appendChild($cell); }); $root->appendChild($item); } $doc->appendChild($root); $doc->documentElement->setAttribute('class', 'foo'); echo $doc->saveHTML($doc->documentElement);
Output for git.master, git.master_jit, rfc.property-hooks
<table class="foo"> <tr> <td>john</td> <td>doe</td> <td>john.doe@example.com</td> </tr> <tr> <td>jane</td> <td>doe</td> <td>jane.doe@example.com</td> </tr> </table>

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