3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function makeCatList($param){ $arResult = array(); $s = array("/[aаА]/ui","/[bбБ]/ui","/[cсС]/ui","/[dдД]/ui","/[eеЕ]/ui","/[tтТ]/ui","/[rрР]/ui","TB"); $r = array("A","B","C","D","E","T","r","Tb",); preg_replace($param["string"]); if(preg_match_all("/((?:[A-D]1)|(?:[A-D][E]?)|(Tr|Tb))/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 5.3.0 - 7.1.0
Warning: preg_replace() expects at least 3 parameters, 1 given in /in/Pq507 on line 6 Array ( [0] => Array ( [0] => Tr ) [1] => Array ( [0] => Tr ) [2] => Array ( [0] => Tr ) ) 1
Output for 4.3.0 - 5.2.17
Warning: Wrong parameter count for preg_replace() in /in/Pq507 on line 6 Array ( [0] => Array ( [0] => Tr ) [1] => Array ( [0] => Tr ) [2] => Array ( [0] => Tr ) ) 1