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); foreach(array_filter($arr,function($v,$k){ return $k <= 15 && $k >= 10; },1) as $key => $value) { echo "$key: $value\n"; }
based on 39FGo
Output for 7.1.0
12: 38 15: 36 10: 14 14: 47 13: 15 11: 25
Output for 7.0.14
13: 28 11: 43 15: 27 10: 12 14: 8 12: 18
Output for 7.0.6
13: 50 10: 42 14: 27 15: 13 12: 31 11: 8
Output for 7.0.5
11: 34 15: 30 10: 43 12: 42 13: 36 14: 45
Output for 7.0.4
14: 11 12: 31 15: 9 10: 50 13: 19 11: 10
Output for 7.0.3
10: 37 13: 42 14: 47 15: 31 11: 1 12: 41
Output for 7.0.2
12: 47 15: 11 13: 34 10: 36 14: 6 11: 28
Output for 7.0.1
15: 30 13: 21 11: 0 14: 3 10: 37 12: 33
Output for 7.0.0
13: 34 10: 41 11: 35 12: 29 15: 37 14: 5
Output for hhvm-3.12.0
15: 3 14: 44 12: 11 11: 13 13: 25 10: 35
Output for hhvm-3.10.0
13: 23 15: 42 11: 4 10: 44 14: 12 12: 41
Output for 5.6.21
13: 32 14: 30 15: 27 11: 4 12: 45 10: 50
Output for 5.6.20
14: 12 12: 48 15: 1 10: 15 11: 39 13: 43
Output for 5.6.19
12: 45 14: 19 15: 47 10: 16 13: 26 11: 25
Output for 5.6.18
15: 15 13: 32 12: 49 11: 16 10: 13 14: 29
Output for 5.6.17
15: 23 11: 9 14: 14 12: 19 13: 25 10: 50
Output for 5.6.16
11: 4 13: 24 12: 41 15: 19 14: 36 10: 5
Output for 5.6.15
12: 34 13: 23 10: 21 14: 4 11: 47 15: 38
Output for 5.6.14
10: 8 14: 42 13: 35 11: 12 12: 25 15: 24
Output for 5.6.13
15: 31 14: 37 12: 4 10: 38 13: 46 11: 50
Output for 5.6.12
11: 46 13: 28 15: 30 10: 25 14: 10 12: 17
Output for 5.6.11
15: 24 11: 1 13: 13 10: 20 12: 0 14: 23
Output for 5.6.10
10: 32 13: 37 11: 39 15: 31 12: 2 14: 29
Output for 5.6.9
13: 2 14: 26 10: 42 12: 4 11: 6 15: 11
Output for 5.6.8
12: 29 13: 34 11: 14 14: 23 15: 9 10: 1
Output for 5.3.0 - 5.5.35
Warning: array_filter() expects at most 2 parameters, 3 given in /in/eAvSh on line 11 Warning: Invalid argument supplied for foreach() in /in/eAvSh on line 11
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/eAvSh on line 11
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/eAvSh on line 11
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/eAvSh on line 11
Process exited with code 255.