3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = "/^([A-Z\d]+)\[(?|(\d+)-(\d+)|([A-Z])-([A-Z]))]|([A-Z\d]+)$/"; $strings = [ "SW[1-3]", "LD1[A-D]", "LD1" ]; foreach ($strings as $s) { if (preg_match($pattern, $s, $match)) { if (array_key_exists(4, $match)) { echo $match[4] . PHP_EOL; continue; } foreach (range($match[2], $match[3]) as $m) { echo $match[1] . $m . PHP_EOL; } } }
Output for git.master, git.master_jit, rfc.property-hooks
SW1 SW2 SW3 LD1A LD1B LD1C LD1D LD1

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