3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught ArgumentCountError: preg_replace() expects at least 3 arguments, 1 given in /in/Pq507:6 Stack trace: #0 /in/Pq507(6): preg_replace('\xD0\x90\xD0\xB21be\xD1\x811edeTr') #1 /in/Pq507(14): makeCatList(Array) #2 {main} thrown in /in/Pq507 on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
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 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.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

preferences:
261.14 ms | 403 KiB | 457 Q