3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pre ="<a href=\""; $post= "</a>"; $in = array('http://">http', 'ftp://">ftp', 'mailto://">mailto', '#">HASH', '//">2xfw slash', '\\hostname\xyz\Informatiker.mp4"> bs bs', '\\\\">2x Bw slash', 'file://">file', 'relative/path">relative/path' ); $replacements = array('/((?:href|src) *= *[\'"](?!(http|ftp|mailto|file|javascript|#|[a-z]+:|xx\\\\|\/\/)))(\/?)/i' => "$1" . "http://www.server.tld/ABSOLUTE/PATH/" ); foreach($in as $test) { echo "\n". '<<pre>'; $r = $pre . $test . $post; echo "$r \t\t=>\t\t" . preg_replace(array_keys($replacements), $replacements, $r); echo '</pre>'; }
Output for git.master, git.master_jit, rfc.property-hooks
<<pre><a href="http://">http</a> => <a href="http://">http</a></pre> <<pre><a href="ftp://">ftp</a> => <a href="ftp://">ftp</a></pre> <<pre><a href="mailto://">mailto</a> => <a href="mailto://">mailto</a></pre> <<pre><a href="#">HASH</a> => <a href="#">HASH</a></pre> <<pre><a href="//">2xfw slash</a> => <a href="//">2xfw slash</a></pre> <<pre><a href="\hostname\xyz\Informatiker.mp4"> bs bs</a> => <a href="http://www.server.tld/ABSOLUTE/PATH/\hostname\xyz\Informatiker.mp4"> bs bs</a></pre> <<pre><a href="\\">2x Bw slash</a> => <a href="http://www.server.tld/ABSOLUTE/PATH/\\">2x Bw slash</a></pre> <<pre><a href="file://">file</a> => <a href="file://">file</a></pre> <<pre><a href="relative/path">relative/path</a> => <a href="http://www.server.tld/ABSOLUTE/PATH/relative/path">relative/path</a></pre>

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:
39.06 ms | 402 KiB | 8 Q