3v4l.org

run code in 300+ PHP versions simultaneously
<?php define("STOP",99); function generate_ints($n){ foreach ( range(0,$n) as $number) { yield $number; } } $gen = generate_ints(5); // iterable object can be used in foreach foreach ($gen as $g) { $c = $gen->current(); echo $c; if ($c == 4) { $gen->send(STOP); // injecting a value to stop the generator; } }

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.0130.01018.30
8.3.50.0100.00721.02
8.3.40.0110.00318.71
8.3.30.0100.00720.52
8.3.20.0050.00320.40
8.3.10.0030.00621.11
8.3.00.0040.00423.48
8.2.180.0070.01116.50
8.2.170.0110.00622.96
8.2.160.0060.01220.45
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00721.03
8.2.110.0030.00620.35
8.2.100.0090.00317.66
8.2.90.0050.00319.25
8.2.80.0030.00617.97
8.2.70.0060.00317.63
8.2.60.0060.00318.03
8.2.50.0030.00618.10
8.2.40.0050.00320.35
8.2.30.0040.00419.41
8.2.20.0020.00517.65
8.2.10.0050.00217.57
8.2.00.0000.00717.69
8.1.280.0190.00025.92
8.1.270.0070.00023.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0150.00423.91
8.1.230.0090.00322.65
8.1.220.0000.00817.76
8.1.210.0090.00018.77
8.1.200.0060.00317.35
8.1.190.0030.00617.35
8.1.180.0080.00018.10
8.1.170.0040.00418.72
8.1.160.0030.00522.20
8.1.150.0090.00018.76
8.1.140.0000.00717.46
8.1.130.0030.00317.71
8.1.120.0070.00017.34
8.1.110.0080.00017.45
8.1.100.0070.00017.43
8.1.90.0000.00717.48
8.1.80.0000.00717.45
8.1.70.0030.00317.45
8.1.60.0080.00017.50
8.1.50.0030.00517.49
8.1.40.0080.00017.58
8.1.30.0050.00217.55
8.1.20.0060.00317.57
8.1.10.0050.00317.51
8.1.00.0040.00417.43
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0000.00718.45
8.0.270.0000.00717.18
8.0.260.0000.00716.88
8.0.250.0000.00716.84
8.0.240.0070.00316.86
8.0.230.0070.00016.95
8.0.220.0030.00316.91
8.0.210.0000.00716.78
8.0.200.0030.00317.00
8.0.190.0040.00417.03
8.0.180.0000.00816.81
8.0.170.0040.00416.94
8.0.160.0070.00016.81
8.0.150.0030.00416.84
8.0.140.0000.01116.91
8.0.130.0050.00013.38
8.0.120.0000.00816.87
8.0.110.0040.00416.84
8.0.100.0040.00416.86
8.0.90.0000.00816.93
8.0.80.0060.01416.95
8.0.70.0000.00716.68
8.0.60.0040.00416.92
8.0.50.0000.00716.77
8.0.30.0110.00817.15
8.0.20.0050.01317.40
8.0.10.0060.00316.84
8.0.00.0090.01016.97
7.4.330.0020.00215.07
7.4.320.0060.00316.41
7.4.300.0040.00416.57
7.4.290.0080.00016.62
7.4.280.0000.00716.50
7.4.270.0000.00716.42
7.4.260.0000.00613.34
7.4.250.0030.00616.53
7.4.240.0050.00316.55
7.4.230.0050.00216.68
7.4.220.0090.01516.52
7.4.210.0080.00716.53
7.4.200.0030.00316.60
7.4.190.0030.00316.39
7.4.160.0090.00616.58
7.4.150.0060.01317.40
7.4.140.0120.00517.86
7.4.130.0130.00716.59
7.4.120.0060.01116.51
7.4.110.0100.00716.57
7.4.100.0130.00416.50
7.4.90.0060.01216.59
7.4.80.0130.00419.39
7.4.70.0100.01416.58
7.4.60.0100.00616.58
7.4.50.0030.00516.40
7.4.40.0060.00922.77
7.4.30.0060.01216.51
7.4.00.0030.01415.26
7.3.330.0000.00513.23
7.3.320.0050.00013.21
7.3.310.0030.00316.39
7.3.300.0060.00016.42
7.3.290.0070.00716.43
7.3.280.0100.00616.33
7.3.270.0130.00317.40
7.3.260.0130.00918.24
7.3.250.0100.00816.59
7.3.240.0110.00916.61
7.3.230.0130.01016.55
7.3.210.0120.00616.43
7.3.200.0000.01819.39
7.3.190.0060.01016.36
7.3.180.0120.00316.41
7.3.170.0150.00916.66
7.3.160.0000.01916.54
7.3.120.0120.00415.17
7.2.330.0090.00916.78
7.2.320.0130.00916.82
7.2.310.0090.01616.60
7.2.300.0130.00616.48
7.2.290.0100.00716.82
7.2.00.0000.01619.66
7.1.100.0030.01018.18
7.1.70.0000.01417.25
7.1.60.0120.01219.17
7.1.50.0030.02116.70
7.1.00.0100.06722.27
7.0.200.0030.00716.94
7.0.140.0000.07322.12
7.0.100.0100.05319.90
7.0.90.0030.08020.00
7.0.80.0070.04719.95
7.0.70.0100.04019.87
7.0.60.0070.08719.98
7.0.50.0000.06020.39
7.0.40.0130.08020.10
7.0.30.0000.05320.18
7.0.20.0030.08020.13
7.0.10.0100.08020.09
7.0.00.0000.07020.16
5.6.280.0030.07321.10
5.6.250.0130.06720.57
5.6.240.0130.08020.69
5.6.230.0100.08020.53
5.6.220.0000.09320.74
5.6.210.0100.07320.49
5.6.200.0030.08720.96
5.6.190.0200.06321.04
5.6.180.0030.05721.04
5.6.170.0130.07021.07
5.6.160.0100.08021.08
5.6.150.0130.08021.02
5.6.140.0130.08021.04
5.6.130.0170.07321.11
5.6.120.0000.09320.94
5.6.110.0070.05320.95
5.6.100.0100.07721.07
5.6.90.0030.05020.99
5.6.80.0070.04020.43
5.6.70.0070.04720.32
5.5.380.0170.07320.46
5.5.370.0130.06720.43
5.5.360.0070.08720.35
5.5.350.0000.09320.34
5.5.340.0130.07320.89
5.5.330.0030.08320.93
5.5.320.0100.07320.89
5.5.310.0030.06020.93
5.5.300.0130.05720.76
5.5.290.0070.08020.80
5.5.280.0130.08020.91
5.5.270.0100.07020.92
5.5.260.0200.06720.83
5.5.250.0200.06720.61
5.5.240.0070.06320.27
5.4.450.0030.08019.56
5.4.440.0130.07019.36
5.4.430.0030.05719.50
5.4.420.0070.06719.45
5.4.410.0030.05019.10
5.4.400.0030.04018.90
5.4.40.0070.03716.37
5.4.30.0030.04016.48
5.4.20.0070.03316.39
5.4.10.0030.03716.40
5.4.00.0070.03315.89
5.3.140.0030.03714.57
5.3.130.0000.04014.48
5.3.120.0070.04314.62
5.3.110.0070.04014.57
5.3.100.0000.04014.03
5.3.90.0070.03314.02
5.3.80.0100.03014.11
5.3.70.0000.04014.08
5.3.60.0100.04314.13
5.3.50.0030.03714.08
5.3.40.0030.05013.93
5.3.30.0000.05313.91
5.3.20.0070.06013.76
5.3.10.0000.04313.72
5.3.00.0030.06013.70
5.2.170.0030.03312.37
5.2.160.0000.04012.37
5.2.150.0000.03012.37
5.2.140.0000.03012.37
5.2.130.0070.05012.37
5.2.120.0100.02712.37
5.2.110.0030.02712.37
5.2.100.0070.04012.37
5.2.90.0000.03012.37
5.2.80.0000.03312.37
5.2.70.0030.02712.37
5.2.60.0000.03012.37
5.2.50.0000.04012.37
5.2.40.0000.02712.37
5.2.30.0000.03312.37
5.2.20.0100.02012.37
5.2.10.0030.02712.37
5.2.00.0030.02712.37
5.1.60.0000.02712.37
5.1.50.0030.02312.37
5.1.40.0070.03712.37
5.1.30.0030.02312.37
5.1.20.0070.02712.37
5.1.10.0070.02012.37
5.1.00.0000.02312.37
5.0.50.0000.02712.37
5.0.40.0030.01712.37
5.0.30.0000.02712.37
5.0.20.0030.01712.37
5.0.10.0000.02012.37
5.0.00.0000.03012.37
4.4.90.0000.02012.37
4.4.80.0000.02012.37
4.4.70.0070.01012.37
4.4.60.0030.01312.37
4.4.50.0000.01712.37
4.4.40.0000.02312.37
4.4.30.0000.02012.37
4.4.20.0000.01312.37
4.4.10.0000.02012.37
4.4.00.0030.02012.37
4.3.110.0000.01712.37
4.3.100.0000.02312.37
4.3.90.0070.02012.37
4.3.80.0000.03012.37
4.3.70.0000.01712.37
4.3.60.0030.01012.37
4.3.50.0070.01012.37
4.3.40.0000.02312.37
4.3.30.0000.01712.37
4.3.20.0030.01312.37
4.3.10.0030.01312.37
4.3.00.0000.01312.37

preferences:
60.24 ms | 401 KiB | 5 Q