3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function randList($number) { for ($i=0;$i<$number;$i++) { yield rand(1, 10); } } foreach (randList(10) as $number) { echo "$number "; } echo "\n";
Output for 7.1.0
6 3 3 1 10 2 9 3 6 6
Output for 7.0.14
10 2 4 2 10 6 4 2 1 7
Output for 7.0.10
9 10 2 2 10 4 2 2 4 3
Output for 7.0.9
5 3 10 3 8 6 1 1 5 4
Output for 7.0.8
5 4 10 6 4 4 2 9 5 5
Output for 7.0.7
3 6 5 2 8 8 4 2 2 7
Output for 7.0.6
4 10 1 4 2 1 8 10 4 1
Output for 7.0.5
8 10 6 2 8 6 1 5 8 5
Output for 7.0.4
9 9 10 1 4 8 2 6 3 2
Output for 7.0.3
8 6 7 4 2 10 6 10 6 2
Output for 7.0.2
5 2 8 6 8 8 5 2 5 2
Output for 7.0.1
5 6 9 3 1 10 10 7 1 7
Output for 7.0.0
1 5 3 7 9 9 8 1 7 6
Output for hhvm-3.12.0
10 4 9 10 7 4 2 3 5 10
Output for hhvm-3.10.0
2 3 1 7 5 2 5 6 9 5
Output for 5.6.28
6 1 4 7 6 3 1 10 7 3
Output for 5.6.25
10 3 9 7 10 6 10 6 3 9
Output for 5.6.24
8 3 10 6 4 6 3 8 7 10
Output for 5.6.23
3 6 3 1 3 7 8 6 1 5
Output for 5.6.22
8 6 10 1 8 9 3 9 2 10
Output for 5.6.21
2 9 8 9 7 6 6 6 7 10
Output for 5.6.20
7 7 4 5 2 1 1 5 8 8
Output for 5.6.19
6 4 7 2 3 3 1 10 7 6
Output for 5.6.18
6 10 6 5 7 10 10 8 8 5
Output for 5.6.17
2 6 4 10 10 8 8 4 8 2
Output for 5.6.16
5 10 2 6 3 3 3 2 1 1
Output for 5.6.15
10 10 7 4 8 6 2 2 8 1
Output for 5.6.14
7 6 4 4 5 9 7 2 7 9
Output for 5.6.13
1 3 8 10 6 5 3 7 9 8
Output for 5.6.12
6 8 6 2 6 6 6 4 6 6
Output for 5.6.11
10 3 10 9 8 5 6 10 1 8
Output for 5.6.10
9 9 2 9 8 5 6 1 8 5
Output for 5.6.9
4 7 6 3 9 10 4 4 8 4
Output for 5.6.8
1 5 5 8 5 2 7 6 9 3
Output for 5.6.7
9 9 8 5 7 3 3 3 8 3
Output for 5.6.6
10 9 2 6 2 7 4 5 7 3
Output for 5.6.5
8 8 9 2 7 5 7 8 9 1
Output for 5.6.4
4 1 4 6 1 7 1 8 2 10
Output for 5.6.3
3 1 1 8 2 7 4 9 4 5
Output for 5.6.2
2 8 1 10 10 4 9 4 8 3
Output for 5.6.1
8 6 3 5 10 7 5 1 1 4
Output for 5.6.0
7 9 6 7 9 7 9 9 9 6
Output for 5.5.38
5 7 5 6 9 2 9 1 3 8
Output for 5.5.37
4 3 5 3 2 3 2 5 7 8
Output for 5.5.36
4 7 1 8 8 3 10 1 10 8
Output for 5.5.35
10 1 8 8 6 7 10 3 1 2
Output for 5.5.34
1 7 10 3 4 5 8 6 8 1
Output for 5.5.33
2 9 3 6 8 2 4 3 3 7
Output for 5.5.32
8 5 10 6 9 4 5 1 10 9
Output for 5.5.31
6 4 6 4 8 4 9 5 7 10
Output for 5.5.30
2 1 4 4 6 2 6 3 2 8
Output for 5.5.29
1 10 3 5 9 3 7 6 10 3
Output for 5.5.28
4 5 1 4 9 5 9 3 10 10
Output for 5.5.27
10 4 8 4 4 9 3 2 3 1
Output for 5.5.26
4 2 1 9 7 10 8 10 2 1
Output for 5.5.25
10 10 9 3 5 4 10 2 3 1
Output for 5.5.24
2 5 7 5 5 8 3 4 10 4
Output for 5.5.23
2 5 10 2 5 3 2 3 6 1
Output for 5.5.22
1 5 7 5 7 6 4 5 3 9
Output for 5.5.21
10 4 7 9 1 1 4 5 2 10
Output for 5.5.20
4 2 5 2 1 5 5 9 8 4
Output for 5.5.19
9 4 4 6 4 1 6 2 3 10
Output for 5.5.18
6 10 7 6 10 3 4 2 1 1
Output for 5.5.16
2 1 9 10 10 5 2 4 5 6
Output for 5.5.15
5 1 1 10 10 7 1 10 2 4
Output for 5.5.14
1 2 4 7 7 3 4 9 8 9
Output for 5.5.13
10 8 10 9 9 1 9 7 1 2
Output for 5.5.12
5 7 3 2 7 7 8 10 2 3
Output for 5.5.11
2 5 2 8 5 8 4 7 4 7
Output for 5.5.10
6 2 2 7 1 5 6 8 8 5
Output for 5.5.9
7 9 7 8 6 2 5 6 6 1
Output for 5.5.8
4 3 4 2 1 8 9 9 8 2
Output for 5.5.7
6 3 7 8 8 5 5 8 6 4
Output for 5.5.6
9 4 5 4 8 5 10 3 4 4
Output for 5.5.5
1 3 4 4 9 1 3 4 2 1
Output for 5.5.4
2 2 1 4 9 10 5 1 2 4
Output for 5.5.3
1 1 9 10 2 6 9 9 3 7
Output for 5.5.2
5 6 3 9 10 9 9 2 7 7
Output for 5.5.1
1 2 5 3 10 5 2 1 5 9
Output for 5.5.0
2 7 3 10 10 2 8 10 4 6
Output for 5.4.0 - 5.4.45
Parse error: syntax error, unexpected 'rand' (T_STRING) in /in/iphBc on line 4
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/iphBc on line 4
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_STRING in /in/iphBc on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/iphBc on line 4
Process exited with code 255.