3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ 'CPC >= $0 (Yesterday)', 'CPC (Link) > $100 (Today)' ]; foreach ($strings as $string) { list($metric, $sign, $digit, $time) = preg_match('~([\w ()]+) ([><]=?) \$(\d+) \(([^)]+)\)~', $string, $out) ? array_slice($out, 1) : ['', '', '', '']; echo "metric: $metric, sign: $sign, digit: $digit, time: $time\n"; var_export($metric); // notice no leading or trailing spaces / unwanted characters in the output echo "\n"; var_export($sign); // notice no leading or trailing spaces / unwanted characters in the output echo "\n"; var_export($digit); // notice no leading or trailing spaces / unwanted characters in the output echo "\n"; var_export($time); // notice no leading or trailing spaces / unwanted characters in the output echo "\n----------\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
metric: CPC, sign: >=, digit: 0, time: Yesterday 'CPC' '>=' '0' 'Yesterday' ---------- metric: CPC (Link), sign: >, digit: 100, time: Today 'CPC (Link)' '>' '100' 'Today' ----------

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