3v4l.org

run code in 300+ PHP versions simultaneously
<?php $case = '2 s foo'; function test($case) { $reg1 = <<<'REGEX' / ^ (?<int> (?:\G|(?!\n)) \s*\b \d{1,5} \s* )\K (?<timepart> (?: s | m | h | d ) \b ) (?=(?<string>.+)$) /uix REGEX; $out = preg_replace_callback ($reg1, function($matches){ switch($matches['timepart']){ case 's': $m = 'sec'; break; case 'm': $m = 'min'; break; case 'h': $m = 'hr'; break; case 'd': $m = 'day'; break; } return $m; }, $case); return $out; } $output = test($case); print_r($output);
Output for git.master, git.master_jit, rfc.property-hooks
2 sec foo

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:
42.39 ms | 1487 KiB | 4 Q