3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $html_string = '<div style="font-family:comic sans ms,cursive;"> <div style="font-size:200%;">Some Text </div></div>'; $dom = new DOMDocument; $dom->loadHTML($html_string); $divs = $dom->getElementsByTagName('div'); for($i=0;$i<$divs->length;$i++) { $attrib = $divs->item($i)->getAttribute("style"); echo $attrib; echo '<br />'; }
Output for 5.0.0 - 7.1.0
font-family:comic sans ms,cursive;<br />font-size:200%;<br />
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/fB93m on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/fB93m on line 9
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/fB93m on line 9
Process exited with code 255.