3v4l.org

run code in 300+ PHP versions simultaneously
<?php $in = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html><head><title>...</title></head><body>abc<br /><br/>def<p>ghi<br />jkl</p></body></html>'; $doc = new DOMDOcument; $doc->loadhtml($in); $linebreak = $doc->createTextNode("\n"); foreach(iterator_to_array($doc->getElementsByTagName('br')) as $node) { $node->parentNode->replaceChild($linebreak->cloneNode(), $node); } echo $doc->savehtml();
Output for git.master, git.master_jit, rfc.property-hooks
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html><head><title>...</title></head><body>abc def<p>ghi jkl</p></body></html>

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:
70.59 ms | 405 KiB | 5 Q