3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function makeCatList($param){ $arResult = array(); $s = array("@[aаА]@u","@[bбБ]@u","@[cсС]@u","@[dдД]@u","@[eеЕ]@u","@[tтТ]@u","@[rрР]@u","@TB@u"); $r = array("A","B","C","D","E","T","r","Tb"); $param["string"] = preg_replace($s, $r, $param["string"]); if(preg_match_all("/((?:[A-D]1)|(?:[A-D][E]?)|(Tr|Tb))/u", $param["string"], $mCats)){ $arCats = sort($mCats[0]); return asort($arCats); } else return false; } print_r(makeCatList(array("string"=>"сАв1beс1edeTr")));
Output for 4.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: asort() expects parameter 1 to be array, boolean given in /in/vARuS on line 10
Output for hhvm-3.10.0 - 3.12.0
Warning: Invalid operand type was used: asort expects array(s) or collection(s) in /in/vARuS on line 10