3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = <<<DATA <a href="fruit.html">The Apple red</a> <a href="Construction.html#one">The big Home</a> <a href="automotive.html?lang=en">Car for rent</a> <a href="fruit.html">The Pineapple red</a> <a href="Construction.html#one">The biggest Home</a> <a href="automotive.html?lang=en">Cars for rent</a> DATA; $dom = new DOMDocument(); $dom->loadHTML($data); foreach($dom->getElementsByTagName("a") as $element) { if (preg_match('#\b(?:apple|big|car)\b#i', $element->nodeValue)) { echo $element->getAttribute("href") . PHP_EOL; } }
Output for git.master_jit, git.master, rfc.property-hooks
fruit.html Construction.html#one automotive.html?lang=en

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:
164.55 ms | 405 KiB | 5 Q