3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $test = [ '1' , '2', '3' ]; rsort( array_map($test, 'intval') ); var_dump($test);
based on 35BBn
Output for 7.0.0 - 7.3.0beta1
Warning: array_map() expects parameter 1 to be a valid callback, array must have exactly two members in /in/7EtEL on line 8 Notice: Only variables should be passed by reference in /in/7EtEL on line 8 Warning: rsort() expects parameter 1 to be array, null given in /in/7EtEL on line 8 array(3) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(1) "3" }
Output for hhvm-3.22.0
Warning: Invalid argument: function: not a valid callback array in /in/7EtEL on line -1 Warning: array_map(): Argument #2 should be an array or collection in /in/7EtEL on line -1 Warning: Invalid operand type was used: rsort expects array(s) or collection(s) in /in/7EtEL on line -1 array(3) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(1) "3" }
Output for hhvm-3.21.3
Warning: Invalid argument: function: not a valid callback array in /in/7EtEL on line 9 Warning: array_map(): Argument #2 should be an array or collection in /in/7EtEL on line 9 Warning: Invalid operand type was used: rsort expects array(s) or collection(s) in /in/7EtEL on line 9 array(3) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(1) "3" }
Output for hhvm-3.18.5
Warning: Invalid argument: function: not a valid callback array Warning: array_map(): Argument #2 should be an array or collection Warning: Invalid operand type was used: rsort expects array(s) or collection(s) in /in/7EtEL on line 9 array(3) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(1) "3" }
Output for 5.6.0 - 5.6.30
Warning: array_map() expects parameter 1 to be a valid callback, array must have exactly two members in /in/7EtEL on line 8 Strict Standards: Only variables should be passed by reference in /in/7EtEL on line 9 Warning: rsort() expects parameter 1 to be array, null given in /in/7EtEL on line 9 array(3) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(1) "3" }