3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $rand = range(0, 50); shuffle($rand); $rand2 = range(0, 50); shuffle($rand2); $arr = array_combine($rand, $rand2); $arr = array_filter($arr,function($k){ return $k <= 15 && $k >= 10; },2); ksort($arr); foreach($arr as $key => $value) { echo "$key: $value\n"; }
based on ksauR
Output for 7.1.0
10: 35 11: 45 12: 47 13: 49 14: 43 15: 18
Output for 7.0.14
10: 5 11: 7 12: 37 13: 47 14: 45 15: 0
Output for 7.0.6
10: 5 11: 28 12: 11 13: 49 14: 13 15: 19
Output for 7.0.5
10: 38 11: 47 12: 43 13: 39 14: 4 15: 49
Output for 7.0.4
10: 7 11: 13 12: 37 13: 22 14: 26 15: 31
Output for 7.0.3
10: 46 11: 25 12: 3 13: 35 14: 37 15: 7
Output for 7.0.2
10: 29 11: 48 12: 39 13: 15 14: 31 15: 34
Output for 7.0.1
10: 30 11: 34 12: 14 13: 36 14: 45 15: 41
Output for 7.0.0
10: 30 11: 13 12: 50 13: 32 14: 24 15: 15
Output for hhvm-3.12.0
10: 19 11: 36 12: 1 13: 34 14: 24 15: 40
Output for hhvm-3.10.0
10: 13 11: 7 12: 50 13: 26 14: 37 15: 4
Output for 5.6.28
10: 7 11: 46 12: 10 13: 2 14: 3 15: 4
Output for 5.6.21
10: 27 11: 49 12: 14 13: 22 14: 0 15: 17
Output for 5.6.20
10: 48 11: 8 12: 34 13: 26 14: 24 15: 6
Output for 5.6.19
10: 31 11: 5 12: 13 13: 12 14: 37 15: 38
Output for 5.6.18
10: 6 11: 13 12: 0 13: 23 14: 5 15: 47
Output for 5.6.17
10: 3 11: 48 12: 40 13: 21 14: 36 15: 49
Output for 5.6.16
10: 41 11: 20 12: 11 13: 37 14: 17 15: 2
Output for 5.6.15
10: 46 11: 40 12: 8 13: 34 14: 50 15: 2
Output for 5.6.14
10: 9 11: 13 12: 44 13: 3 14: 2 15: 16
Output for 5.6.13
10: 7 11: 39 12: 28 13: 33 14: 12 15: 21
Output for 5.6.12
10: 18 11: 11 12: 29 13: 36 14: 14 15: 47
Output for 5.6.11
10: 45 11: 2 12: 31 13: 33 14: 0 15: 40
Output for 5.6.10
10: 7 11: 28 12: 21 13: 46 14: 23 15: 34
Output for 5.6.9
10: 24 11: 17 12: 41 13: 7 14: 22 15: 25
Output for 5.6.8
10: 33 11: 28 12: 45 13: 6 14: 5 15: 29
Output for 5.6.7
10: 18 11: 29 12: 12 13: 5 14: 22 15: 44
Output for 5.3.0 - 5.5.35
Warning: array_filter() expects at most 2 parameters, 3 given in /in/nvgc1 on line 10 Warning: ksort() expects parameter 1 to be array, null given in /in/nvgc1 on line 11 Warning: Invalid argument supplied for foreach() in /in/nvgc1 on line 13
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/nvgc1 on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/nvgc1 on line 10
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/nvgc1 on line 10
Process exited with code 255.