3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array( '0' => Array ( '0' => '5522 8600 0000 0000', '1' => '2020', '2' => '09' ), '1' => Array ( '0' => '09', '1' => '5522 8600 0000 0000', '2' => '2020' ), '2' => Array ( '0' => '5522 8600 0000 0000', '1' => '20', '2' => '9' ) ); $finalArray = []; foreach($array as $key=>$arr){ $arry = []; foreach($arr as $ar){ if(strlen($ar) > 4){ $arry[0] = $ar; }else if((strlen($ar) ==1 || strlen($ar) == 2) && (int)$ar <=12){ $arry[1] = $ar; }else{ $arry[2] = $ar; } } ksort($arry); $finalArray[$key] = $arry; } print_r($finalArray);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [0] => 5522 8600 0000 0000 [1] => 09 [2] => 2020 ) [1] => Array ( [0] => 5522 8600 0000 0000 [1] => 09 [2] => 2020 ) [2] => Array ( [0] => 5522 8600 0000 0000 [1] => 9 [2] => 20 ) )

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:
123.08 ms | 406 KiB | 5 Q