3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(1,-1,0,NULL,2,0,-2);$b = array(NULL,-1,0,1,2,-2, 0);$c = array(0,1,-1,0,-2,2,NULL);echo "asort(array(1,-1,0,NULL,2,0,-2))\n";asort($a);print_r($a);echo "\nasort(array(NULL,-1,0,1,2,-2, 0))\n";asort($b);print_r($b);echo "\nasort(array(0,1,-1,0,-2,2,NULL))\n";asort($c);print_r($c);
Output for hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
asort(array(1,-1,0,NULL,2,0,-2)) Array ( [6] => -2 [1] => -1 [2] => 0 [3] => [5] => 0 [0] => 1 [4] => 2 ) asort(array(NULL,-1,0,1,2,-2, 0)) Array ( [0] => [5] => -2 [1] => -1 [2] => 0 [6] => 0 [3] => 1 [4] => 2 ) asort(array(0,1,-1,0,-2,2,NULL)) Array ( [4] => -2 [2] => -1 [0] => 0 [3] => 0 [6] => [1] => 1 [5] => 2 )
Output for 4.3.0 - 5.6.28
asort(array(1,-1,0,NULL,2,0,-2)) Array ( [5] => 0 [2] => 0 [3] => [6] => -2 [1] => -1 [0] => 1 [4] => 2 ) asort(array(NULL,-1,0,1,2,-2, 0)) Array ( [5] => -2 [1] => -1 [6] => 0 [2] => 0 [0] => [3] => 1 [4] => 2 ) asort(array(0,1,-1,0,-2,2,NULL)) Array ( [6] => [4] => -2 [2] => -1 [3] => 0 [0] => 0 [1] => 1 [5] => 2 )