3v4l.org

run code in 300+ PHP versions simultaneously
<?php $body = "Text text #hashtag text text #hast/tag"; $hashtag_path = '/path/to'; $hashtags_url = '/#(\S+)/'; $body = preg_replace_callback( $hashtags_url, function($matches) use ($hashtag_path) { return "<a href=\"$hashtag_path/hashtag/".urlencode($matches[1])."\">".$matches[0]."</a>"; }, $body); echo $body;
Output for git.master, git.master_jit, rfc.property-hooks
Text text <a href="/path/to/hashtag/hashtag">#hashtag</a> text text <a href="/path/to/hashtag/hast%2Ftag">#hast/tag</a>

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