3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $p = '<p>I am <strong>Bold</strong>!</p>'; $dom = new \DOMDocument( '1.0', 'UTF-8' ); $dom->loadHTML( "<content>{$p}</content>" ); $list = $dom->getElementsByTagName( 'p' ); $node = $list->item( 0 ); echo $node;
based on V7rk7
Output for 7.1.0 - 7.2.0
Warning: DOMDocument::loadHTML(): Tag content invalid in Entity, line: 1 in /in/tDljQ on line 6 Recoverable fatal error: Object of class DOMElement could not be converted to string in /in/tDljQ on line 10
Process exited with code 255.
Output for 5.3.17 - 7.0.20
Warning: DOMDocument::loadHTML(): Tag content invalid in Entity, line: 1 in /in/tDljQ on line 6 Catchable fatal error: Object of class DOMElement could not be converted to string in /in/tDljQ on line 10
Process exited with code 255.