3v4l.org

run code in 300+ PHP versions simultaneously
<?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; } makeCatList(array("string"=>"dсАв1beс1edeTr"));
Output for 8.3.0 - 8.3.6
Fatal error: Uncaught TypeError: asort(): Argument #1 ($array) must be of type array, true given in /in/ivpFA:10 Stack trace: #0 /in/ivpFA(10): asort(true) #1 /in/ivpFA(13): makeCatList(Array) #2 {main} thrown in /in/ivpFA on line 10
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Fatal error: Uncaught TypeError: asort(): Argument #1 ($array) must be of type array, bool given in /in/ivpFA:10 Stack trace: #0 /in/ivpFA(10): asort(true) #1 /in/ivpFA(13): makeCatList(Array) #2 {main} thrown in /in/ivpFA on line 10
Process exited with code 255.
Output for 7.3.12 - 7.3.33, 7.4.0 - 7.4.33
Warning: asort() expects parameter 1 to be array, bool given in /in/ivpFA on line 10
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, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33
Warning: asort() expects parameter 1 to be array, boolean given in /in/ivpFA on line 10

preferences:
218.23 ms | 404 KiB | 315 Q