3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Function to create a dynamic replacement. * @param array $match An array with the match of the pattern. * @return string The replacement. */ function getReplacement($match) { if (isset($match[0])) { return $match[0].'<br/>'; } } //the value to replace specific parts. $string = 'Tip #1 some #12 random #123 text #1234, an #12345 example #123456'; //replace all parts starting with '#' and three numbers following. echo preg_replace_callback('/#[0-9]+/', 'getReplacement', $string);
Output for git.master, git.master_jit, rfc.property-hooks
Tip #1<br/> some #12<br/> random #123<br/> text #1234<br/>, an #12345<br/> example #123456<br/>

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.63 ms | 401 KiB | 8 Q