3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input_string = "Last time it rained was on 07/25/2013 and today is 08/09/2013."; if(preg_match_all("/\d{2}\/\d{2}\/\d{4}/", $input_string, $match)) { $replacements =array(); foreach ($match as $m) { foreach($m as $i){ $i = '/'.implode('\/',explode('/',$i)) . '/'; } } //$match[0][0] = '/'.implode('\/',explode('/',$match[0][0])) . '/'; //$match[0][1] = '/'.implode('\/',explode('/',$match[0][1])) . '/'; print_r($match); $replacements[0] = 'test1'; $replacements[1] = 'test2'; echo preg_replace($match[0], $replacements, $input_string); }
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [0] => 07/25/2013 [1] => 08/09/2013 ) ) Warning: preg_replace(): Delimiter must not be alphanumeric, backslash, or NUL in /in/19h4l on line 18

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:
65.72 ms | 401 KiB | 8 Q