3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <!DOCTYPE HTML> <html> <body> <p><span class="unwrap_me">Lorem</span><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); } }
Output for git.master, git.master_jit
Fatal error: Uncaught DOMException: Not Found Error in /in/KjJgQ:17 Stack trace: #0 /in/KjJgQ(17): DOMElement->replaceWith(Object(DOMText)) #1 {main} thrown in /in/KjJgQ on line 17 free(): double free detected in tcache 2
Process exited with code 134.
Output for rfc.property-hooks

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:
30.43 ms | 406 KiB | 5 Q