3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array('one' => 1, 'two' => 2, 'three' => 3, 'four' => 4, 'five' => 5); print_r(array_rand($arr,sizeof($arr)));
Output for 5.2.10 - 5.6.28, 7.0.0 - 7.1.0
Array ( [0] => one [1] => two [2] => three [3] => four [4] => five )
Output for hhvm-3.12.0
Array ( [0] => four [1] => one [2] => two [3] => five [4] => three )
Output for hhvm-3.10.0
Array ( [0] => four [1] => five [2] => two [3] => one [4] => three )
Output for 5.2.9
Array ( [0] => five [1] => two [2] => four [3] => one [4] => three )
Output for 4.3.8, 5.2.8
Array ( [0] => three [1] => four [2] => one [3] => two [4] => five )
Output for 5.2.7
Array ( [0] => one [1] => three [2] => five [3] => four [4] => two )
Output for 5.2.6
Array ( [0] => five [1] => two [2] => three [3] => one [4] => four )
Output for 5.2.5
Array ( [0] => four [1] => one [2] => three [3] => five [4] => two )
Output for 5.2.4
Array ( [0] => five [1] => one [2] => three [3] => four [4] => two )
Output for 4.4.0, 5.2.3
Array ( [0] => four [1] => two [2] => three [3] => one [4] => five )
Output for 5.2.2
Array ( [0] => five [1] => two [2] => one [3] => three [4] => four )
Output for 4.3.2, 5.2.1
Array ( [0] => three [1] => one [2] => five [3] => four [4] => two )
Output for 5.2.0
Array ( [0] => two [1] => one [2] => four [3] => five [4] => three )
Output for 5.1.6
Array ( [0] => one [1] => two [2] => five [3] => three [4] => four )
Output for 5.1.5
Array ( [0] => three [1] => four [2] => two [3] => one [4] => five )
Output for 5.1.4
Array ( [0] => one [1] => four [2] => five [3] => two [4] => three )
Output for 5.1.3
Array ( [0] => three [1] => one [2] => four [3] => five [4] => two )
Output for 5.1.2
Array ( [0] => two [1] => one [2] => five [3] => three [4] => four )
Output for 5.1.1
Array ( [0] => one [1] => five [2] => three [3] => two [4] => four )
Output for 5.1.0
Array ( [0] => four [1] => one [2] => five [3] => three [4] => two )
Output for 5.0.3, 5.0.5
Array ( [0] => five [1] => four [2] => three [3] => one [4] => two )
Output for 5.0.4
Array ( [0] => one [1] => two [2] => four [3] => three [4] => five )
Output for 5.0.2
Array ( [0] => three [1] => five [2] => two [3] => one [4] => four )
Output for 5.0.1
Array ( [0] => three [1] => two [2] => one [3] => four [4] => five )
Output for 5.0.0
Array ( [0] => five [1] => four [2] => two [3] => one [4] => three )
Output for 4.4.9
Array ( [0] => four [1] => two [2] => three [3] => five [4] => one )
Output for 4.4.8
Array ( [0] => one [1] => four [2] => three [3] => two [4] => five )
Output for 4.4.7
Array ( [0] => two [1] => five [2] => four [3] => three [4] => one )
Output for 4.4.6
Array ( [0] => four [1] => five [2] => two [3] => three [4] => one )
Output for 4.4.5
Array ( [0] => two [1] => three [2] => five [3] => one [4] => four )
Output for 4.4.1, 4.4.4
Array ( [0] => one [1] => three [2] => two [3] => four [4] => five )
Output for 4.4.3
Array ( [0] => three [1] => five [2] => one [3] => two [4] => four )
Output for 4.4.2
Array ( [0] => four [1] => five [2] => one [3] => three [4] => two )
Output for 4.3.3 - 4.3.4, 4.3.11
Array ( [0] => four [1] => five [2] => three [3] => two [4] => one )
Output for 4.3.10
Array ( [0] => three [1] => four [2] => one [3] => five [4] => two )
Output for 4.3.9
Array ( [0] => two [1] => five [2] => one [3] => four [4] => three )
Output for 4.3.7
Array ( [0] => four [1] => two [2] => one [3] => three [4] => five )
Output for 4.3.6
Array ( [0] => four [1] => one [2] => three [3] => two [4] => five )
Output for 4.3.5
Array ( [0] => three [1] => five [2] => four [3] => two [4] => one )
Output for 4.3.1
Array ( [0] => one [1] => three [2] => four [3] => two [4] => five )
Output for 4.3.0
Array ( [0] => two [1] => three [2] => one [3] => four [4] => five )