3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function makeCatList($param){ $arResult = array(); if(preg_match_all("/((?:[a-dA-DавсдАВСД]1)|(?:[a-dA-DавсдАВСД][eEеЕ]?)|([tTтТ][rRрР]|[tTтТ][bBбБ]))/u", $param["string"], $mCats)){ //unset($mCats[0]); print_r($mCats); return asort($mCats); } else return false; } print_r(makeCatList(array("string"=>"Ав1beс1edeTr")));
Output for 4.3.3 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => Array ( [0] => А [1] => в1 [2] => be [3] => с1 [4] => de [5] => Tr ) [1] => Array ( [0] => А [1] => в1 [2] => be [3] => с1 [4] => de [5] => Tr ) [2] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => Tr ) ) 1
Output for 4.3.0 - 4.3.2
Array ( [0] => Array ( [0] => � [1] => �1 [2] => be [3] => �1 [4] => de [5] => Tr ) [1] => Array ( [0] => � [1] => �1 [2] => be [3] => �1 [4] => de [5] => Tr ) [2] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => Tr ) ) 1