3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = <<< HTML <a>some stuff we don not want</a> <table cellpadding="2" cellspacing="1" bgcolor="#A0A0A0"> </table> <table id="anothertable"> </table> HTML; $dom = new DOMDocument(); $dom->loadHTML($input); foreach ($dom->getElementsByTagName('table') as $element) { var_dump($element; }
Output for 5.4.18
Parse error: syntax error, unexpected ';' in /in/k06Lq on line 14
Process exited with code 255.
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.17
Parse error: syntax error, unexpected ';' in /in/1nLE1 on line 14
Process exited with code 255.

preferences:
184.85 ms | 1395 KiB | 54 Q