3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <div> <p> some text <a href="../plugins/re_records/somefile.php?page=something&id=345">find_me_1</a></p> <br> <a href="../plugins/re_records/somefile.php?page=something&id=99">find_me_2</a> <div> <div> <a href="example.com?page=something&id=55">don't even think about it!</a> <a href="../plugins/re_records/somefile.php?page=something&id=90210">find_me_3</a> </div> </div> </div> HTML; $hrefStartsWith = '../plugins/re_records/somefile.php?page=something&id='; $dom = new DOMDocument(); libxml_use_internal_errors(true); $dom->loadHTML($html, LIBXML_HTML_NODEFDTD | LIBXML_HTML_NOIMPLIED); $xpath = new DOMXPath($dom); foreach ($xpath->query("//a[starts-with(@href, '$hrefStartsWith')]") as $a) { $a->setAttribute('href', '/map/' . $a->nodeValue); } echo $dom->saveHTML();
Output for git.master, git.master_jit, rfc.property-hooks
<div> <p> some text <a href="/map/find_me_1">find_me_1</a></p> <br> <a href="/map/find_me_2">find_me_2</a> <div> <div> <a href="example.com?page=something&amp;id=55">don't even think about it!</a> <a href="/map/find_me_3">find_me_3</a> </div> </div> </div>

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:
170.49 ms | 406 KiB | 5 Q