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]); print_r($mCats); return asort($arCats); } else return false; } print_r(makeCatList(array("string"=>"сАв1beс1edeTr")));
Output for git.master, git.master_jit
Array ( [0] => Array ( [0] => A [1] => BE [2] => C [3] => C1 [4] => DE [5] => Tr ) [1] => Array ( [0] => C [1] => A [2] => BE [3] => C1 [4] => DE [5] => Tr ) [2] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => Tr ) ) Fatal error: Uncaught TypeError: asort(): Argument #1 ($array) must be of type array, bool given in /in/vpruf:11 Stack trace: #0 /in/vpruf(11): asort(true) #1 /in/vpruf(14): makeCatList(Array) #2 {main} thrown in /in/vpruf on line 11
Process exited with code 255.
Output for rfc.property-hooks
Array ( [0] => Array ( [0] => A [1] => BE [2] => C [3] => C1 [4] => DE [5] => Tr ) [1] => Array ( [0] => C [1] => A [2] => BE [3] => C1 [4] => DE [5] => Tr ) [2] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => Tr ) ) Fatal error: Uncaught TypeError: asort(): Argument #1 ($array) must be of type array, true given in /in/vpruf:11 Stack trace: #0 /in/vpruf(11): asort(true) #1 /in/vpruf(14): makeCatList(Array) #2 {main} thrown in /in/vpruf on line 11
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
41.16 ms | 402 KiB | 8 Q