3v4l.org

run code in 300+ PHP versions simultaneously
<?php $htmlString = '<p>Test</p> <h2>Test2</h2> <table> <thead> <tr> <td>Header 1</td> <td>Header 2</td> </tr> </thead> <tbody> <tr> <td>Col 1</td> <td>Col 2</td> </tr> </tbody> </table> <span>Test span </span> '; $dom = new DOMDocument(); $dom->loadHTML($htmlString, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $dom->preserveWhiteSpace = true; $tables = $dom->getElementsByTagName('table'); foreach($tables as $table) { var_dump($dom->saveHTML($table)); }
Output for git.master, git.master_jit, rfc.property-hooks
string(286) "<table> <thead> <tr> <td>Header 1</td> <td>Header 2</td> </tr> </thead> <tbody> <tr> <td>Col 1</td> <td>Col 2</td> </tr> </tbody> </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:
29.52 ms | 406 KiB | 5 Q