3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = <<<DATA <li class="four-column mosaicElement"> <a href="https://example.com" title="Lorem ipsum"> </a> </li> <li class="four-column mosaicElement"> <a href="https://example.org" title="Lorem ipsum"> </a> </li> DATA; $dom = new DOMDocument(); $dom->loadHTML($string); $xpath = new DOMXpath($dom); foreach($xpath->query("//li[contains(@class, 'four-column') and contains(@class, 'mosaicElement')]/a") as $v) { echo $v->getAttribute("href") . PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
https://example.com https://example.org

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
126.43 ms | 405 KiB | 5 Q