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 during iteration ',$times,"\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.60.0100.01018.43
8.3.50.0140.00921.33
8.3.40.0070.00718.84
8.3.30.0070.01020.29
8.3.20.0050.00320.48
8.3.10.0080.00021.22
8.3.00.0040.00422.49
8.2.180.0070.00716.75
8.2.170.0060.01222.96
8.2.160.0120.00320.44
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0070.00021.04
8.2.110.0030.00619.34
8.2.100.0040.00817.84
8.2.90.0040.00419.22
8.2.80.0040.00418.05
8.2.70.0040.00417.63
8.2.60.0040.00418.16
8.2.50.0060.00318.07
8.2.40.0040.00418.28
8.2.30.0050.00519.51
8.2.20.0000.00817.71
8.2.10.0040.00417.82
8.2.00.0060.00317.89
8.1.280.0100.01025.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00623.98
8.1.230.0070.00320.97
8.1.220.0040.00418.77
8.1.210.0000.00819.04
8.1.200.0030.00617.48
8.1.190.0000.00817.61
8.1.180.0000.01018.10
8.1.170.0050.00318.49
8.1.160.0000.00818.86
8.1.150.0030.00718.75
8.1.140.0040.00417.53
8.1.130.0040.00417.88
8.1.120.0000.00817.37
8.1.110.0030.00517.42
8.1.100.0000.00817.43
8.1.90.0000.00817.48
8.1.80.0050.00217.47
8.1.70.0000.00717.44
8.1.60.0040.00417.60
8.1.50.0050.00217.52
8.1.40.0040.00417.43
8.1.30.0080.00017.53
8.1.20.0050.00317.73
8.1.10.0000.00817.57
8.1.00.0080.00017.38
8.0.300.0040.00420.04
8.0.290.0050.00317.18
8.0.280.0070.00018.37
8.0.270.0040.00417.18
8.0.260.0030.00316.90
8.0.250.0030.00316.97
8.0.240.0000.00816.92
8.0.230.0000.00717.04
8.0.220.0000.00717.03
8.0.210.0070.00016.83
8.0.200.0000.00617.06
8.0.190.0000.00717.05
8.0.180.0030.00516.99
8.0.170.0040.00416.88
8.0.160.0030.00316.92
8.0.150.0030.00416.89
8.0.140.0030.00616.82
8.0.130.0000.00513.36
8.0.120.0000.00816.93
8.0.110.0050.00216.97
8.0.100.0070.00016.85
8.0.90.0070.00016.84
8.0.80.0090.00616.97
8.0.70.0000.00717.01
8.0.60.0050.00317.04
8.0.50.0070.00017.00
8.0.30.0090.01117.21
8.0.20.0080.01017.40
8.0.10.0040.00416.89
8.0.00.0090.00816.79
7.4.330.0000.00516.89
7.4.320.0000.00716.46
7.4.300.0060.00016.52
7.4.290.0030.00316.60
7.4.280.0000.00716.52
7.4.270.0000.00716.43
7.4.260.0030.00313.24
7.4.250.0040.00416.48
7.4.240.0000.00716.50
7.4.230.0070.00016.63
7.4.220.0110.00816.68
7.4.210.0070.01016.58
7.4.200.0000.00716.41
7.4.190.0070.00016.49
7.4.160.0100.00616.45
7.4.150.0040.01417.40
7.4.140.0050.01317.86
7.4.130.0070.01216.67
7.4.120.0100.01016.62
7.4.110.0030.01316.55
7.4.100.0170.00016.63
7.4.90.0100.00716.55
7.4.80.0080.01219.39
7.4.70.0030.02016.52
7.4.60.0120.00416.74
7.4.50.0040.00416.28
7.4.40.0030.01322.77
7.4.30.0100.01016.57
7.4.00.0000.01615.23
7.3.330.0050.00013.46
7.3.320.0000.00513.45
7.3.310.0070.00016.34
7.3.300.0000.00716.44
7.3.290.0000.01316.46
7.3.280.0090.00516.46
7.3.270.0120.01217.40
7.3.260.0090.01018.24
7.3.250.0090.00916.60
7.3.240.0100.00916.67
7.3.230.0070.01016.50
7.3.210.0070.01116.46
7.3.200.0080.01119.39
7.3.190.0100.01016.55
7.3.180.0180.00316.74
7.3.170.0030.01716.52
7.3.160.0180.00316.56
7.3.120.0040.01114.62
7.2.330.0140.00316.83
7.2.320.0070.01016.88
7.2.310.0070.01016.50
7.2.300.0000.01916.81
7.2.290.0100.00716.78
7.2.00.0030.01119.37
7.1.100.0030.00618.13
7.1.70.0040.00417.22
7.1.60.0100.01619.17
7.1.50.0070.01117.07
7.1.00.0030.09022.44
7.0.200.0000.00916.73
7.0.140.0030.07721.95
7.0.60.0100.07720.08
7.0.50.0170.04717.90
7.0.40.0000.04720.14
7.0.30.0270.04320.30
7.0.20.0200.04320.21
7.0.10.0170.05020.23
7.0.00.0030.08320.21
5.6.280.0000.07321.15
5.6.210.0030.06720.55
5.6.200.0070.03718.15
5.6.190.0130.08320.61
5.6.180.0270.07720.50
5.6.170.0330.08720.39
5.6.160.0070.05720.42
5.6.150.0100.06318.15
5.6.140.0070.06718.13
5.6.130.0070.05718.14
5.6.120.0070.06321.00
5.6.110.0130.08020.90
5.6.100.0030.08721.02
5.6.90.0100.08021.10
5.6.80.0100.07320.38
5.6.70.0270.06020.35
5.5.350.0230.07720.44
5.5.340.0070.06717.99
5.5.330.0200.08020.45
5.5.320.0270.05320.38
5.5.310.0300.04720.24
5.5.300.0130.05318.03
5.5.290.0070.06718.08
5.5.280.0100.04020.73
5.5.270.0170.07320.65
5.5.260.0200.07020.86
5.5.250.0100.08020.70
5.5.240.0030.04020.07
5.4.450.0330.05719.48
5.4.440.0230.04719.55
5.4.430.0200.04719.34
5.4.420.0230.06019.16
5.4.410.0330.07319.28
5.4.400.0300.07019.14
5.4.390.0270.05319.20
5.4.380.0200.04319.05
5.4.370.0230.04019.20
5.4.360.0330.06318.87
5.4.350.0130.05319.24
5.4.340.0300.06719.09
5.4.320.0200.04719.09
5.4.310.0300.03719.09
5.4.300.0170.04719.10
5.4.290.0230.05319.00
5.4.280.0200.07719.16
5.4.270.0230.07019.02
5.4.260.0230.04019.19
5.4.250.0130.05019.13
5.4.240.0270.07019.06
5.4.230.0330.04019.16
5.4.220.0370.06719.08
5.4.210.0330.04319.23
5.4.200.0230.04319.21
5.4.190.0200.04318.85
5.4.180.0130.04719.07
5.4.170.0200.04019.30
5.4.160.0230.03719.17
5.4.150.0300.05319.13
5.4.140.0330.05716.37
5.4.130.0230.06316.30
5.4.120.0230.04316.50
5.4.110.0270.04016.36
5.4.100.0300.03016.45
5.4.90.0400.05316.45
5.4.80.0530.02716.55
5.4.70.0300.04016.18
5.4.60.0300.03316.16
5.4.50.0300.04016.51
5.4.40.0270.07316.42
5.4.30.0330.04316.22
5.4.20.0300.04716.53
5.4.10.0230.03716.16
5.4.00.0330.05715.77
5.3.290.0330.06314.63
5.3.280.0300.07714.56
5.3.270.0300.07314.61
5.3.260.0270.05014.75
5.3.250.0230.04714.62
5.3.240.0200.04014.75
5.3.230.0270.05714.59
5.3.220.0300.04014.48
5.3.210.0370.06714.48
5.3.200.0200.04314.49
5.3.190.0330.02714.68
5.3.180.0200.04014.65
5.3.170.0300.06714.61
5.3.160.0230.03314.54
5.3.150.0200.06314.49
5.3.140.0270.03714.67
5.3.130.0300.06714.47
5.3.120.0200.05314.45
5.3.110.0270.03014.55
5.3.100.0130.04314.04
5.3.90.0230.07314.10
5.3.80.0270.03713.92
5.3.70.0330.06713.92
5.3.60.0270.04014.08
5.3.50.0200.03713.95
5.3.40.0270.07713.92
5.3.30.0200.05014.05
5.3.20.0200.05313.66
5.3.10.0170.03713.73
5.3.00.0170.04013.54
5.2.170.0270.05312.84
5.2.160.0200.05712.84
5.2.150.0130.04012.84
5.2.140.0270.05712.84
5.2.130.0130.03012.84
5.2.120.0130.03012.84
5.2.110.0130.03312.84
5.2.100.0170.05712.84
5.2.90.0170.04712.84
5.2.80.0170.03012.84
5.2.70.0130.03312.84
5.2.60.0170.05012.84
5.2.50.0200.03012.84
5.2.40.0130.03712.84
5.2.30.0130.03012.84
5.2.20.0230.04712.84
5.2.10.0170.04312.84
5.2.00.0200.05712.84
5.1.60.0130.03712.84
5.1.50.0130.02712.84
5.1.40.0270.04012.84
5.1.30.0070.03312.84
5.1.20.0170.04012.84
5.1.10.0270.04312.84
5.1.00.0170.03312.84
5.0.50.0130.03012.84
5.0.40.0070.03712.84
5.0.30.0100.05712.84
5.0.20.0070.02712.84
5.0.10.0070.02012.84
5.0.00.0070.06012.84
4.4.90.0070.03312.84
4.4.80.0100.02712.84
4.4.70.0070.01712.84
4.4.60.0070.03312.84
4.4.50.0100.02312.84
4.4.40.0070.05712.84
4.4.30.0100.02312.84
4.4.20.0170.01012.84
4.4.10.0070.01712.84
4.4.00.0100.03012.84
4.3.110.0130.01712.84
4.3.100.0070.02012.84
4.3.90.0070.03012.84
4.3.80.0170.02712.84
4.3.70.0100.02312.84
4.3.60.0100.02712.84
4.3.50.0130.03012.84
4.3.40.0200.02012.84
4.3.30.0030.03712.84
4.3.20.0100.02312.84
4.3.10.0070.02012.84
4.3.00.0100.01312.84

preferences:
45.66 ms | 401 KiB | 5 Q