3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <!DOCTYPE HTML> <html> <body> <p><span class="unwrap_me">ipsum</span><span class="unwrap_me">dolor</span></p> </body> </html> HTML; $dom = new DOMDocument(); $dom->loadHTML($html); $spans = iterator_to_array($dom->getElementsByTagName('span')->getIterator()); foreach ($spans as $span) { if ('unwrap_me' === $span->getAttribute('class')) { $span->replaceWith(...$span->childNodes); } } echo $dom->saveHTML();
Output for git.master, git.master_jit
<!DOCTYPE HTML> <html><body> <p>ipsum<span class="unwrap_me"></span></p> </body></html> free(): double free detected in tcache 2
Process exited with code 134.
Output for rfc.property-hooks
<!DOCTYPE HTML> <html><body> <p>ipsumdolor</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:
35.77 ms | 406 KiB | 5 Q