3v4l.org

run code in 300+ PHP versions simultaneously
<?php function nums() { $ary = [24,25,26,27,28,29,30,31,32]; for($x = 0, $max = count($ary); $x < $max; $x += 2) { $cmd = (yield $ary[$x]); // yield expr if ($cmd == 'stop') { echo 'Stopped and closed generator',"\n"; return; } } } $gen = nums(); $times = 1; foreach ($gen as $value) { echo "$value at iteration $times","\n"; $times++; if ($value == 28) { // don't let it get to 32 $gen->send('stop'); } }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.40.0150.00018.98
8.3.30.0090.00618.81
8.3.20.0030.00618.87
8.3.10.0080.00020.52
8.3.00.0040.00419.51
8.2.170.0090.00622.96
8.2.160.0040.01120.47
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00326.16
8.2.120.0100.00019.36
8.2.110.0090.00020.94
8.2.100.0060.00617.84
8.2.90.0090.00019.30
8.2.80.0080.00018.03
8.2.70.0040.00417.63
8.2.60.0000.00817.80
8.2.50.0060.00318.07
8.2.40.0080.00018.28
8.2.30.0000.00718.20
8.2.20.0000.00717.74
8.2.10.0000.00817.63
8.2.00.0040.00417.74
8.1.270.0000.00824.66
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0040.00422.55
8.1.230.0080.00420.97
8.1.220.0000.00817.78
8.1.210.0030.00719.04
8.1.200.0100.00017.35
8.1.190.0040.00417.40
8.1.180.0090.00018.10
8.1.170.0000.00918.75
8.1.160.0040.00418.94
8.1.150.0040.00418.63
8.1.140.0000.00717.38
8.1.130.0000.00817.76
8.1.120.0070.00017.46
8.1.110.0040.00417.45
8.1.100.0070.00017.47
8.1.90.0060.00317.42
8.1.80.0040.00417.45
8.1.70.0070.00017.43
8.1.60.0000.01117.63
8.1.50.0060.00317.39
8.1.40.0070.00017.42
8.1.30.0000.00717.59
8.1.20.0050.00317.56
8.1.10.0040.00417.58
8.1.00.0040.00417.53
8.0.300.0040.00419.97
8.0.290.0070.00016.63
8.0.280.0000.00918.42
8.0.270.0000.00717.27
8.0.260.0030.00316.84
8.0.250.0040.00416.86
8.0.240.0030.00516.83
8.0.230.0030.00316.96
8.0.220.0030.00316.92
8.0.210.0000.00616.87
8.0.200.0000.00817.00
8.0.190.0000.00816.82
8.0.180.0050.00316.81
8.0.170.0040.00416.81
8.0.160.0050.00316.90
8.0.150.0000.00816.80
8.0.140.0000.00816.77
8.0.130.0000.00613.27
8.0.120.0040.00416.88
8.0.110.0000.00716.77
8.0.100.0040.00416.80
8.0.90.0040.00416.79
8.0.80.0040.01116.83
8.0.70.0050.00316.91
8.0.60.0000.00716.83
8.0.50.0040.00416.95
8.0.30.0020.01717.19
8.0.20.0120.00617.00
8.0.10.0040.00416.96
8.0.00.0110.00816.53
7.4.330.0000.00612.99
7.4.320.0030.00316.60
7.4.300.0000.00716.63
7.4.290.0030.00316.56
7.4.280.0040.00416.50
7.4.270.0000.00716.61
7.4.260.0030.00313.23
7.4.250.0030.00616.65
7.4.240.0000.00716.43
7.4.230.0030.00316.68
7.4.220.0090.00916.62
7.4.210.0100.00416.60
7.4.200.0080.00016.63
7.4.190.0000.00716.74
7.4.160.0100.00716.39
7.4.150.0110.00716.44
7.4.140.0110.01016.50
7.4.130.0080.00816.67
7.4.120.0130.00416.49
7.4.110.0100.00716.60
7.4.100.0070.01016.48
7.4.90.0160.01016.50
7.4.80.0030.01819.39
7.4.70.0140.00416.46
7.4.60.0000.01516.34
7.4.50.0040.00416.67
7.4.40.0070.00716.47
7.4.30.0130.00316.37
7.4.00.0060.01214.79
7.3.330.0000.00613.37
7.3.320.0000.00513.34
7.3.310.0030.00316.34
7.3.300.0070.00016.21
7.3.290.0060.00916.37
7.3.280.0110.01016.35
7.3.270.0000.01916.37
7.3.260.0110.00716.46
7.3.250.0100.01116.38
7.3.240.0080.00816.36
7.3.230.0060.01116.39
7.3.210.0060.01116.51
7.3.200.0100.00616.39
7.3.190.0110.00916.38
7.3.180.0030.01316.50
7.3.170.0170.00316.62
7.3.160.0030.01316.40
7.3.120.0100.00714.91
7.3.10.0090.00616.14
7.3.00.0070.00716.48
7.2.330.0100.00716.80
7.2.320.0060.01216.38
7.2.310.0130.01016.68
7.2.300.0130.00316.81
7.2.290.0070.01016.85
7.2.130.0170.00516.64
7.2.120.0130.01016.31
7.2.110.0040.01216.72
7.2.100.0110.01216.73
7.2.90.0140.00316.78
7.2.80.0150.00716.54
7.2.70.0100.00716.50
7.2.60.0130.00216.55
7.2.50.0110.00416.79
7.2.40.0110.00316.57
7.2.30.0100.01016.37
7.2.20.0150.00316.48
7.2.10.0150.00916.81
7.2.00.0110.00717.00
7.1.250.0120.00415.47
7.1.200.0030.01015.77
7.1.70.0000.00917.20
7.1.60.0000.02219.40
7.1.50.0070.01316.91
7.1.00.0030.07022.44
7.0.200.0150.00315.09
7.0.140.0000.07722.09
7.0.120.0100.06022.04
7.0.60.0070.08719.83
7.0.50.0070.08717.73
7.0.40.0000.05017.74
7.0.30.0130.06317.71
7.0.20.0030.08717.69
7.0.10.0070.07017.87
7.0.00.0030.06017.75
5.6.280.0030.07320.86
5.6.210.0100.07020.65
5.6.200.0070.08318.14
5.6.190.0100.08718.22
5.6.180.0070.04718.28
5.6.170.0130.08018.18
5.6.160.0030.05018.25
5.6.150.0130.05018.29
5.6.140.0130.07018.28
5.6.130.0070.08318.17
5.6.120.0030.04718.28
5.6.110.0100.08318.16
5.6.100.0000.08718.14
5.6.90.0130.05718.13
5.6.80.0200.07017.57
5.6.70.0130.07317.53
5.6.60.0100.07717.59
5.6.50.0030.06717.53
5.6.40.0030.05317.57
5.6.30.0100.07717.57
5.6.20.0070.08017.62
5.6.10.0170.06717.55
5.6.00.0070.08017.49
5.5.350.0230.08320.32
5.5.340.0100.04718.09
5.5.330.0070.06317.98
5.5.320.0170.07018.03
5.5.310.0070.07717.94
5.5.300.0100.04017.95
5.5.290.0070.08717.97
5.5.280.0030.08717.96
5.5.270.0070.07017.94
5.5.260.0100.06017.93
5.5.250.0130.03717.89
5.5.240.0130.06317.37
5.5.230.0200.05017.36
5.5.220.0030.06717.35
5.5.210.0070.04717.30
5.5.200.0070.06717.34
5.5.190.0030.07717.30
5.5.180.0170.07317.33
5.5.160.0070.07717.30
5.5.150.0000.08717.42
5.5.140.0070.07717.37
5.5.130.0100.07317.35
5.5.120.0030.05717.38
5.5.110.0130.06717.30
5.5.100.0000.07717.20
5.5.90.0070.05717.20
5.5.80.0030.04017.20
5.5.70.0100.07317.20
5.5.60.0100.04017.23
5.5.50.0030.04017.32
5.5.40.0000.06017.20
5.5.30.0000.04017.21
5.5.20.0070.07717.28
5.5.10.0100.07017.31
5.5.00.0070.05717.30
5.4.450.0070.04019.21
5.4.440.0130.08019.37
5.4.430.0030.07719.37
5.4.420.0100.04719.42
5.4.410.0070.04019.33
5.4.400.0070.07719.06
5.4.390.0030.06719.27
5.4.380.0070.06719.13
5.4.370.0100.06719.05
5.4.360.0000.08718.88
5.4.350.0170.07318.97
5.4.340.0070.07719.07
5.4.320.0130.03719.03
5.4.310.0030.04019.16
5.4.300.0070.05019.01
5.4.290.0100.07318.88
5.4.280.0030.08319.09
5.4.270.0100.07719.12
5.4.260.0030.08018.98
5.4.250.0070.07019.06
5.4.240.0070.04318.88
5.4.230.0000.04719.09
5.4.220.0030.04019.20
5.4.210.0030.04319.09
5.4.200.0070.04018.96
5.4.190.0100.03719.09
5.4.180.0130.06319.03
5.4.170.0130.03719.08
5.4.160.0070.05318.86
5.4.150.0130.03018.96
5.4.140.0070.04016.38
5.4.130.0130.03716.39
5.4.120.0070.05716.19
5.4.110.0170.06016.37
5.4.100.0030.05316.34
5.4.90.0030.04316.45
5.4.80.0070.04016.41
5.4.70.0130.07016.44
5.4.60.0030.05316.32
5.4.50.0070.05716.35
5.4.40.0030.07316.58
5.4.30.0070.04716.35
5.4.20.0030.06316.53
5.4.10.0070.06716.41
5.4.00.0070.05715.74
5.3.290.0070.04314.70
5.3.280.0100.07314.65
5.3.270.0100.05714.66
5.3.260.0100.04714.64
5.3.250.0130.03314.62
5.3.240.0030.07714.67
5.3.230.0030.08014.44
5.3.220.0100.07014.62
5.3.210.0070.08014.57
5.3.200.0100.07014.66
5.3.190.0200.06014.58
5.3.180.0100.06714.61
5.3.170.0170.06714.52
5.3.160.0030.07714.60
5.3.150.0030.04714.60
5.3.140.0130.05714.59
5.3.130.0070.07714.58
5.3.120.0130.06714.59
5.3.110.0070.07714.59
5.3.100.0070.07714.04
5.3.90.0130.07013.97
5.3.80.0130.07313.86
5.3.70.0030.07714.07
5.3.60.0030.05013.89
5.3.50.0030.05713.98
5.3.40.0030.07713.98
5.3.30.0070.04013.95
5.3.20.0030.08013.79
5.3.10.0070.05013.64
5.3.00.0070.04713.55
5.2.170.0100.06011.14
5.2.160.0000.04311.17
5.2.150.0000.05011.19
5.2.140.0030.05011.36
5.2.130.0070.05711.09
5.2.120.0030.05311.20
5.2.110.0100.05711.11
5.2.100.0030.06311.19
5.2.90.0100.04711.15
5.2.80.0030.06711.13
5.2.70.0100.04011.14
5.2.60.0100.05711.08
5.2.50.0100.06011.12
5.2.40.0100.03011.20
5.2.30.0030.06011.01
5.2.20.0030.06010.82
5.2.10.0030.03010.84
5.2.00.0030.03010.78
5.1.60.0100.04310.07
5.1.50.0030.02710.06
5.1.40.0100.0239.95
5.1.30.0030.03710.18
5.1.20.0030.02310.37
5.1.10.0000.0279.91
5.1.00.0070.02010.07
5.0.50.0000.0238.54
5.0.40.0030.0238.43
5.0.30.0000.0308.20
5.0.20.0030.0178.23
5.0.10.0000.0208.21
5.0.00.0030.0278.23
4.4.90.0000.0237.88
4.4.80.0070.0307.88
4.4.70.0000.0177.88
4.4.60.0030.0137.88
4.4.50.0030.0137.88
4.4.40.0000.0507.88
4.4.30.0000.0177.88
4.4.20.0000.0177.88
4.4.10.0000.0177.88
4.4.00.0030.0237.88
4.3.110.0000.0177.88
4.3.100.0000.0177.88
4.3.90.0000.0137.88
4.3.80.0030.0207.88
4.3.70.0000.0177.88
4.3.60.0000.0137.88
4.3.50.0000.0177.88
4.3.40.0000.0237.88
4.3.30.0000.0207.88
4.3.20.0000.0377.88
4.3.10.0000.0207.88
4.3.00.0000.0177.88

preferences:
54.62 ms | 400 KiB | 5 Q