3v4l.org

run code in 300+ PHP versions simultaneously
<?php $homepage = "https://example.com/"; $html = '<img class="drt" src="100.png"><img src="../101.png"><img src="/102.png"><img src="103.png">'; $check_img = preg_match_all("/<img .*?(?=src)src=\"([^\"]+)\"/si", $html, $m); foreach ($m[1] as $img){ if (strpos($img, $homepage) == false) { $old_img = $img; $html = str_replace($old_img, $homepage.basename($old_img), $html); } } echo $html;
Output for git.master, git.master_jit, rfc.property-hooks
<img class="drt" src="https://example.com/100.png"><img src="https://example.com/101.png"><img src="https://example.com/102.png"><img src="https://example.com/103.png">

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