3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <a href="http://aaa.com">http://aaa.com</a> HTML; $dom = new DomDocument(); $dom->loadHTML($html); foreach ($dom->getElementsByTagName('a') as $link) { var_dump($link->getAttribute('href')); }

preferences:
51.93 ms | 402 KiB | 5 Q