3v4l.org

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

preferences:
129.91 ms | 401 KiB | 174 Q