3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data = array( 'C' => array (10.33,'ka'=> array ('e','d','mmm'),'fff','nnn'), 'A' => array (15,45 => array (14.5,75,21.9),17), 'L', 'N', 'TGHI' => array('bbb','aaa',14,37.3), 18, 1, 59); array_walk_recursive($data, "sort"); var_dump($data);
Output for 7.0.0 - 7.1.0
Warning: sort() expects parameter 1 to be array, float given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, float given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, float given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, float given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 array(8) { ["C"]=> array(4) { [0]=> float(10.33) ["ka"]=> array(3) { [0]=> string(1) "e" [1]=> string(1) "d" [2]=> string(3) "mmm" } [1]=> string(3) "fff" [2]=> string(3) "nnn" } ["A"]=> array(3) { [0]=> int(15) [45]=> array(3) { [0]=> float(14.5) [1]=> int(75) [2]=> float(21.9) } [46]=> int(17) } [0]=> string(1) "L" [1]=> string(1) "N" ["TGHI"]=> array(4) { [0]=> string(3) "bbb" [1]=> string(3) "aaa" [2]=> int(14) [3]=> float(37.3) } [2]=> int(18) [3]=> int(1) [4]=> int(59) }
Output for hhvm-3.10.0 - 3.12.0
Warning: Invalid operand type was used: sort expects array(s) or collection(s) in /in/VCLII on line 12 Warning: Invalid operand type was used: sort expects array(s) or collection(s) in /in/VCLII on line 12 Warning: Invalid operand type was used: sort expects array(s) or collection(s) in /in/VCLII on line 12 Warning: Invalid operand type was used: sort expects array(s) or collection(s) in /in/VCLII on line 12 Warning: Invalid operand type was used: sort expects array(s) or collection(s) in /in/VCLII on line 12 Warning: Invalid operand type was used: sort expects array(s) or collection(s) in /in/VCLII on line 12 Warning: Invalid operand type was used: sort expects array(s) or collection(s) in /in/VCLII on line 12 Warning: Invalid operand type was used: sort expects array(s) or collection(s) in /in/VCLII on line 12 Warning: Invalid operand type was used: sort expects array(s) or collection(s) in /in/VCLII on line 12 Warning: Invalid operand type was used: sort expects array(s) or collection(s) in /in/VCLII on line 12 Warning: Invalid operand type was used: sort expects array(s) or collection(s) in /in/VCLII on line 12 Warning: Invalid operand type was used: sort expects array(s) or collection(s) in /in/VCLII on line 12 Warning: Invalid operand type was used: sort expects array(s) or collection(s) in /in/VCLII on line 12 Warning: Invalid operand type was used: sort expects array(s) or collection(s) in /in/VCLII on line 12 Warning: Invalid operand type was used: sort expects array(s) or collection(s) in /in/VCLII on line 12 Warning: Invalid operand type was used: sort expects array(s) or collection(s) in /in/VCLII on line 12 array(8) { ["C"]=> array(4) { [0]=> float(10.33) ["ka"]=> array(3) { [0]=> string(1) "e" [1]=> string(1) "d" [2]=> string(3) "mmm" } [1]=> string(3) "fff" [2]=> string(3) "nnn" } ["A"]=> array(3) { [0]=> int(15) [45]=> array(3) { [0]=> float(14.5) [1]=> int(75) [2]=> float(21.9) } [46]=> int(17) } [0]=> string(1) "L" [1]=> string(1) "N" ["TGHI"]=> array(4) { [0]=> string(3) "bbb" [1]=> string(3) "aaa" [2]=> int(14) [3]=> float(37.3) } [2]=> int(18) [3]=> int(1) [4]=> int(59) }
Output for 5.0.1 - 5.0.5, 5.2.6 - 5.6.28
Warning: sort() expects parameter 1 to be array, double given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, double given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, double given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, double given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 array(8) { ["C"]=> array(4) { [0]=> float(10.33) ["ka"]=> array(3) { [0]=> string(1) "e" [1]=> string(1) "d" [2]=> string(3) "mmm" } [1]=> string(3) "fff" [2]=> string(3) "nnn" } ["A"]=> array(3) { [0]=> int(15) [45]=> array(3) { [0]=> float(14.5) [1]=> int(75) [2]=> float(21.9) } [46]=> int(17) } [0]=> string(1) "L" [1]=> string(1) "N" ["TGHI"]=> array(4) { [0]=> string(3) "bbb" [1]=> string(3) "aaa" [2]=> int(14) [3]=> float(37.3) } [2]=> int(18) [3]=> int(1) [4]=> int(59) }
Output for 5.1.0 - 5.2.5
Warning: sort() expects parameter 1 to be array, double given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, double given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, double given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, double given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, integer given in /in/VCLII on line 12 array(8) { ["C"]=> &array(4) { [0]=> float(10.33) ["ka"]=> &array(3) { [0]=> string(1) "e" [1]=> string(1) "d" [2]=> string(3) "mmm" } [1]=> string(3) "fff" [2]=> string(3) "nnn" } ["A"]=> &array(3) { [0]=> int(15) [45]=> &array(3) { [0]=> float(14.5) [1]=> int(75) [2]=> float(21.9) } [46]=> int(17) } [0]=> string(1) "L" [1]=> string(1) "N" ["TGHI"]=> &array(4) { [0]=> string(3) "bbb" [1]=> string(3) "aaa" [2]=> int(14) [3]=> float(37.3) } [2]=> int(18) [3]=> int(1) [4]=> int(59) }
Output for 5.0.0
Warning: sort() expects parameter 1 to be array, double given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12 Warning: sort() expects parameter 1 to be array, string given in /in/VCLII on line 12
Process exited with code 139.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: array_walk_recursive() in /in/VCLII on line 12
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: array_walk_recursive() in /in/VCLII on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: array_walk_recursive() in /in/VCLII on line 12