3v4l.org

run code in 300+ PHP versions simultaneously
<?php define("STOP",0); function generate_ints($n){ foreach ( range(0,$n) as $number) { $number = (yield $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; echo $gen->current; } }

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.0090.00918.24
8.3.50.0110.00921.15
8.3.40.0110.00318.59
8.3.30.0070.00720.31
8.3.20.0080.00020.54
8.3.10.0040.00421.02
8.3.00.0080.00023.61
8.2.180.0060.00916.88
8.2.170.0070.01022.96
8.2.160.0130.00320.43
8.2.150.0040.00424.18
8.2.140.0060.00624.66
8.2.130.0000.00826.16
8.2.120.0070.00021.18
8.2.110.0030.00619.39
8.2.100.0060.00617.91
8.2.90.0040.00419.05
8.2.80.0000.00919.47
8.2.70.0000.00817.47
8.2.60.0000.00918.04
8.2.50.0070.00318.07
8.2.40.0050.00318.22
8.2.30.0040.00419.50
8.2.20.0040.00417.54
8.2.10.0070.00017.71
8.2.00.0020.00517.56
8.1.280.0090.00625.92
8.1.270.0000.00823.99
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0000.01222.39
8.1.230.0110.00020.91
8.1.220.0030.00518.77
8.1.210.0000.00818.77
8.1.200.0040.00417.36
8.1.190.0040.00417.52
8.1.180.0060.00318.10
8.1.170.0030.00518.43
8.1.160.0030.00518.84
8.1.150.0000.00918.55
8.1.140.0000.00717.41
8.1.130.0030.00317.90
8.1.120.0000.00817.36
8.1.110.0070.00017.34
8.1.100.0000.00717.39
8.1.90.0000.00717.38
8.1.80.0040.00417.49
8.1.70.0000.00717.27
8.1.60.0040.00417.58
8.1.50.0040.00417.53
8.1.40.0040.00417.46
8.1.30.0040.00417.64
8.1.20.0000.00817.56
8.1.10.0050.00317.39
8.1.00.0040.00417.45
8.0.300.0070.00019.97
8.0.290.0040.00417.30
8.0.280.0000.00718.45
8.0.270.0000.00717.27
8.0.260.0040.00416.88
8.0.250.0000.00817.02
8.0.240.0030.00717.04
8.0.230.0050.00217.10
8.0.220.0000.00716.87
8.0.210.0000.00716.94
8.0.200.0030.00317.09
8.0.190.0050.00217.02
8.0.180.0000.00716.91
8.0.170.0050.00216.88
8.0.160.0040.00416.97
8.0.150.0040.00416.84
8.0.140.0030.00716.94
8.0.130.0000.00513.41
8.0.120.0070.00016.84
8.0.110.0000.00816.98
8.0.100.0000.00717.06
8.0.90.0000.00716.91
8.0.80.0080.00817.02
8.0.70.0040.00417.00
8.0.60.0000.00716.95
8.0.50.0070.00016.81
8.0.30.0130.00817.17
8.0.20.0050.01217.40
8.0.10.0050.00317.19
8.0.00.0100.00816.76
7.4.330.0000.00516.76
7.4.320.0000.00916.63
7.4.300.0070.00016.49
7.4.290.0070.00016.60
7.4.280.0030.00316.63
7.4.270.0030.00316.57
7.4.260.0000.00813.30
7.4.250.0080.00016.48
7.4.240.0020.00516.66
7.4.230.0070.00016.66
7.4.220.0100.01016.59
7.4.210.0070.00916.54
7.4.200.0040.00216.50
7.4.190.0000.00716.44
7.4.160.0040.01116.61
7.4.150.0090.00817.40
7.4.140.0140.00617.86
7.4.130.0110.00716.51
7.4.120.0060.01116.43
7.4.110.0190.00416.50
7.4.100.0130.00316.49
7.4.90.0130.01016.47
7.4.80.0090.00919.39
7.4.70.0060.01216.37
7.4.60.0030.01316.47
7.4.50.0030.00616.48
7.4.40.0030.01022.77
7.4.30.0100.01116.61
7.4.00.0090.00615.04
7.3.330.0000.00513.43
7.3.320.0000.00513.34
7.3.310.0070.00016.32
7.3.300.0000.00616.43
7.3.290.0070.00716.41
7.3.280.0110.00616.43
7.3.270.0110.00717.40
7.3.260.0100.01318.24
7.3.250.0130.00816.39
7.3.240.0140.00616.58
7.3.230.0130.00716.49
7.3.210.0060.01616.47
7.3.200.0180.00519.39
7.3.190.0030.01316.48
7.3.180.0100.01016.48
7.3.170.0060.01616.70
7.3.160.0110.00516.43
7.3.120.0060.01115.02
7.3.110.0110.00714.93
7.3.100.0060.01314.89
7.3.90.0030.01014.68
7.3.80.0110.00414.93
7.3.70.0080.00814.96
7.3.60.0030.01014.98
7.3.50.0120.00314.59
7.3.40.0000.01014.74
7.3.30.0070.00414.83
7.3.20.0070.00716.57
7.3.10.0040.00816.56
7.3.00.0100.00616.63
7.2.330.0120.00616.72
7.2.320.0110.00716.59
7.2.310.0030.01516.91
7.2.300.0070.01116.54
7.2.290.0060.00916.83
7.2.250.0060.01015.11
7.2.240.0070.01114.97
7.2.230.0130.00615.19
7.2.220.0130.00315.33
7.2.210.0070.01015.15
7.2.200.0080.00415.21
7.2.190.0030.00615.21
7.2.180.0040.00415.20
7.2.170.0040.00814.93
7.2.160.0030.00714.89
7.2.150.0000.01016.71
7.2.140.0000.01116.95
7.2.130.0040.00816.81
7.2.120.0120.00316.99
7.2.110.0090.00317.04
7.2.100.0060.00616.99
7.2.90.0070.00717.09
7.2.80.0090.00616.76
7.2.70.0060.00316.82
7.2.60.0040.00716.79
7.2.50.0060.00316.84
7.2.40.0060.00917.01
7.2.30.0030.00616.80
7.2.20.0030.01016.96
7.2.10.0060.01316.86
7.2.00.0020.01118.36
7.1.330.0070.01016.05
7.1.320.0000.01716.00
7.1.310.0040.01115.90
7.1.300.0030.00815.88
7.1.290.0040.01115.91
7.1.280.0040.00815.80
7.1.270.0030.00515.71
7.1.260.0130.00015.96
7.1.250.0070.01015.89
7.1.240.0070.00715.83
7.1.230.0080.00415.85
7.1.220.0070.00315.69
7.1.210.0090.00015.88
7.1.200.0000.01015.89
7.1.190.0120.00315.99
7.1.180.0030.00615.83
7.1.170.0040.01115.90
7.1.160.0060.00315.75
7.1.150.0000.00815.85
7.1.140.0030.01015.86
7.1.130.0000.01715.65
7.1.120.0030.00715.97
7.1.110.0000.01215.61
7.1.100.0030.01016.69
7.1.90.0030.00915.74
7.1.80.0060.00615.93
7.1.70.0020.01016.62
7.1.60.0110.00817.49
7.1.50.0080.01016.36
7.1.40.0050.00515.54
7.1.30.0120.00015.90
7.1.20.0070.00715.95
7.1.10.0030.00916.01
7.1.00.0030.04319.26
7.0.330.0030.01015.28
7.0.320.0030.00515.34
7.0.310.0060.01015.34
7.0.300.0070.00715.44
7.0.290.0090.00315.62
7.0.280.0030.00915.18
7.0.270.0030.00715.39
7.0.260.0040.00715.53
7.0.250.0070.00415.61
7.0.240.0070.00715.23
7.0.230.0060.00315.27
7.0.220.0060.00615.62
7.0.210.0070.00815.64
7.0.200.0080.00515.96
7.0.190.0100.00315.48
7.0.180.0060.00615.18
7.0.170.0040.01115.56
7.0.160.0030.00615.42
7.0.150.0090.00315.29
7.0.140.0050.04118.62
7.0.130.0060.00915.53
7.0.120.0070.00715.35
7.0.110.0080.02217.76
7.0.100.0080.03917.61
7.0.90.0110.03717.73
7.0.80.0210.03317.81
7.0.70.0300.02817.57
7.0.60.0270.03217.85
7.0.50.0240.03117.64
7.0.40.0070.04016.55
7.0.30.0000.03616.51
7.0.20.0040.03716.63
7.0.10.0060.03216.70
7.0.00.0110.03816.53
5.6.400.0080.00814.41
5.6.390.0030.01314.61
5.6.380.0090.00614.52
5.6.370.0030.01314.47
5.6.360.0060.00614.73
5.6.350.0090.00014.59
5.6.340.0000.01314.46
5.6.330.0000.01414.39
5.6.320.0030.00614.56
5.6.310.0070.01114.62
5.6.300.0030.00714.23
5.6.290.0000.01214.11
5.6.280.0040.03917.57
5.6.270.0000.01014.14
5.6.260.0030.03017.43
5.6.250.0050.03617.55
5.6.240.0030.03017.52
5.6.230.0050.04517.56
5.6.220.0000.03017.45
5.6.210.0140.01817.51
5.6.200.0110.02317.48
5.6.190.0070.02217.48
5.6.180.0080.01817.29
5.6.170.0020.03317.35
5.6.160.0080.03617.43
5.6.150.0030.04217.70
5.6.140.0090.04017.58
5.6.130.0020.02417.50
5.6.120.0030.03317.47
5.6.110.0030.02417.41
5.6.100.0050.02617.42
5.6.90.0050.02417.49
5.6.80.0010.02317.19
5.6.70.0070.02316.97
5.6.60.0070.02317.08
5.6.50.0040.03017.16
5.6.40.0040.02117.05
5.6.30.0010.02717.13
5.6.20.0030.02317.07
5.6.10.0060.02117.23
5.6.00.0080.01817.00
5.5.380.0050.02615.86
5.5.370.0030.04016.09
5.5.360.0000.03515.90
5.5.350.0070.04515.97
5.5.340.0050.04716.03
5.5.330.0020.04216.17
5.5.320.0120.02816.32
5.5.310.0050.03716.19
5.5.300.0020.04016.07
5.5.290.0030.02516.19
5.5.280.0050.02716.26
5.5.270.0080.02416.16
5.5.260.0080.02215.89
5.5.250.0000.03016.11
5.5.240.0040.02315.87
5.5.230.0070.02515.81
5.5.220.0070.02215.74
5.5.210.0000.02815.91
5.5.200.0030.02315.76
5.5.190.0050.02015.74
5.5.180.0030.02515.71
5.5.170.0070.00714.11
5.5.160.0060.01915.87
5.5.150.0070.01915.76
5.5.140.0030.02215.95
5.5.130.0100.02015.91
5.5.120.0090.02215.72
5.5.110.0040.02215.84
5.5.100.0080.02415.76
5.5.90.0040.02615.72
5.5.80.0080.02015.87
5.5.70.0020.02515.71
5.5.60.0090.01715.58
5.5.50.0060.01815.83
5.5.40.0090.01815.68
5.5.30.0050.02615.63
5.5.20.0000.02815.49
5.5.10.0030.02215.92
5.5.00.0020.02215.66
5.4.450.0070.02615.84
5.4.440.0040.02215.89
5.4.430.0030.02715.84
5.4.420.0050.02515.85
5.4.410.0050.02115.85
5.4.400.0080.01815.68
5.4.390.0040.02215.80
5.4.380.0020.02115.77
5.4.370.0020.02015.70
5.4.360.0080.01815.77
5.4.350.0020.02215.68
5.4.340.0050.01515.77
5.4.330.0030.00612.36
5.4.320.0090.01815.78
5.4.310.0020.03415.68
5.4.300.0020.01915.68
5.4.290.0040.02015.77
5.4.280.0080.01715.66
5.4.270.0050.02015.77
5.4.260.0030.02615.72
5.4.250.0030.02415.85
5.4.240.0050.02315.67
5.4.230.0050.01815.77
5.4.220.0070.02015.71
5.4.210.0020.02215.79
5.4.200.0020.02215.70
5.4.190.0000.02315.68
5.4.180.0050.01515.67
5.4.170.0040.02015.83
5.4.160.0040.02015.79
5.4.150.0030.02015.71
5.4.140.0020.02514.42
5.4.130.0060.01814.34
5.4.120.0020.02414.42
5.4.110.0000.02414.48
5.4.100.0020.02114.47
5.4.90.0020.02514.47
5.4.80.0030.01914.45
5.4.70.0010.02414.35
5.4.60.0010.02014.40
5.4.50.0030.03714.30
5.4.40.0020.02014.49
5.4.30.0000.02214.37
5.4.20.0040.02014.37
5.4.10.0030.04114.45
5.4.00.0060.03014.14
5.3.290.0000.02613.58
5.3.280.0070.01513.49
5.3.270.0030.02313.48
5.3.260.0050.01913.46
5.3.250.0030.02113.49
5.3.240.0070.01813.60
5.3.230.0030.01713.55
5.3.220.0050.02013.54
5.3.210.0040.02413.48
5.3.200.0030.02313.45
5.3.190.0050.01713.48
5.3.180.0080.01813.47
5.3.170.0020.01913.53
5.3.160.0050.02013.46
5.3.150.0000.02113.46
5.3.140.0000.02413.46
5.3.130.0030.02213.57
5.3.120.0060.01813.52
5.3.110.0020.02213.44
5.3.100.0010.01913.28
5.3.90.0020.04313.20
5.3.80.0050.04113.20
5.3.70.0040.04513.23
5.3.60.0030.03113.19
5.3.50.0010.02413.15
5.3.40.0030.03713.15
5.3.30.0040.01913.15
5.3.20.0070.03013.03
5.3.10.0030.03713.04
5.3.00.0080.03113.00
5.2.170.0070.05011.93
5.2.160.0030.05711.93
5.2.150.0030.06011.93
5.2.140.0100.05311.93
5.2.130.0070.03011.93
5.2.120.0070.06011.93
5.2.110.0170.05311.93
5.2.100.0030.04711.93
5.2.90.0070.02711.93
5.2.80.0000.05711.93
5.2.70.0070.06011.93
5.2.60.0030.06011.93
5.2.50.0030.03711.93
5.2.40.0030.03011.93
5.2.30.0030.03711.93
5.2.20.0070.03711.93
5.2.10.0030.04011.93
5.2.00.0000.06311.93
5.1.60.0000.04311.93
5.1.50.0030.05311.93
5.1.40.0000.05311.93
5.1.30.0070.03311.93
5.1.20.0070.05011.93
5.1.10.0070.05011.93
5.1.00.0030.05711.93
5.0.50.0030.04311.93
5.0.40.0000.02311.93
5.0.30.0030.07011.93
5.0.20.0000.03311.93
5.0.10.0030.02011.93
5.0.00.0000.03711.93
4.4.90.0030.03311.93
4.4.80.0000.03711.93
4.4.70.0000.03311.93
4.4.60.0000.03711.93
4.4.50.0000.03311.93
4.4.40.0000.04711.93
4.4.30.0030.02011.93
4.4.20.0030.02011.93
4.4.10.0030.02011.93
4.4.00.0030.05011.93
4.3.110.0000.03311.93
4.3.100.0000.02011.93
4.3.90.0000.02311.93
4.3.80.0000.02711.93
4.3.70.0030.02311.93
4.3.60.0030.01311.93
4.3.50.0000.01711.93
4.3.40.0030.02711.93
4.3.30.0070.01011.93
4.3.20.0000.01711.93
4.3.10.0030.03011.93
4.3.00.0000.02011.93

preferences:
45.6 ms | 401 KiB | 5 Q