3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = '3,5,6,9,11,23,14-42'; $result = json_decode('['. preg_replace_callback('/(\d+)-(\d+)/', function($m) { return implode(',', range($m[1], $m[2])); }, $input) .']'); var_dump($result);
Output for git.master, git.master_jit, rfc.property-hooks
array(35) { [0]=> int(3) [1]=> int(5) [2]=> int(6) [3]=> int(9) [4]=> int(11) [5]=> int(23) [6]=> int(14) [7]=> int(15) [8]=> int(16) [9]=> int(17) [10]=> int(18) [11]=> int(19) [12]=> int(20) [13]=> int(21) [14]=> int(22) [15]=> int(23) [16]=> int(24) [17]=> int(25) [18]=> int(26) [19]=> int(27) [20]=> int(28) [21]=> int(29) [22]=> int(30) [23]=> int(31) [24]=> int(32) [25]=> int(33) [26]=> int(34) [27]=> int(35) [28]=> int(36) [29]=> int(37) [30]=> int(38) [31]=> int(39) [32]=> int(40) [33]=> int(41) [34]=> int(42) }

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:
159.31 ms | 407 KiB | 5 Q