3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<p><a href="blahblah">blahblah</a></p>'; $doc = new DOMDocument(); libxml_use_internal_errors(true); $doc->loadHTML($html); libxml_clear_errors(); $test = $doc->querySelector('a'); echo $test->getAttribute('href');

preferences:
25.74 ms | 405 KiB | 5 Q