3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "this is [my] test [string] and [<script>alert(1)</script>] is very long [with] so many pwords]"; echo preg_replace_callback( "#\[([^\]]+)]#", fn($m) => sprintf( '<a href="/story.php?%s">%s</a>', http_build_query(['word' => $m[1]]), htmlspecialchars($m[1]) ), $str );
Output for git.master_jit, git.master, rfc.property-hooks
this is <a href="/story.php?word=my">my</a> test <a href="/story.php?word=string">string</a> and <a href="/story.php?word=%3Cscript%3Ealert%281%29%3C%2Fscript%3E">&lt;script&gt;alert(1)&lt;/script&gt;</a> is very long <a href="/story.php?word=with">with</a> so many pwords]

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