3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,100]; $result = []; foreach($array as $num){ if(strlen($num) < 2){ $result[] = $num; }else{ $parts = str_split($num); $result = array_merge($result,$parts); } } print_r($result); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 8 [8] => 9 [9] => 1 [10] => 0 [11] => 1 [12] => 1 [13] => 1 [14] => 2 [15] => 1 [16] => 3 [17] => 1 [18] => 4 [19] => 1 [20] => 5 [21] => 1 [22] => 0 [23] => 0 )

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.01 ms | 1562 KiB | 4 Q