3v4l.org

run code in 300+ PHP versions simultaneously
<?php $numbers = array(1, 2, 3, 4, 5); $text = array(1 => 'ONE', 2 => 'TWO', 3 => 'THREE', 4 => 'FOUR', 5 => 'FIVE'); function getNumbers($i) { global $numbers; for($j = $numbers[0]; $j <=$numbers; $j++){ yield $j; } } foreach(getNumbers() as $number){ echo $number . ':' . $text[$number] . "\n"; }

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.0030.01018.79
8.3.30.0120.00320.19
8.3.20.0070.00020.16
8.3.10.0040.00420.79
8.3.00.0040.00422.40
8.2.170.0150.00022.96
8.2.160.0030.01022.08
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00420.80
8.2.110.0130.01019.27
8.2.100.0070.00717.78
8.2.90.0070.00018.91
8.2.80.0030.00519.41
8.2.70.0040.00417.50
8.2.60.0070.00317.80
8.2.50.0090.00318.07
8.2.40.0050.00318.15
8.2.30.0080.00019.45
8.2.20.0050.00317.57
8.2.10.0060.00317.73
8.2.00.0000.00917.67
8.1.270.0000.00823.99
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0100.01022.37
8.1.230.0100.00020.86
8.1.220.0080.00018.77
8.1.210.0060.00319.02
8.1.200.0060.00317.35
8.1.190.0040.00417.53
8.1.180.0000.00818.10
8.1.170.0000.00918.34
8.1.160.0000.00818.83
8.1.150.0050.00518.59
8.1.140.0000.00717.35
8.1.130.0030.00317.88
8.1.120.0000.00717.39
8.1.110.0040.00417.30
8.1.100.0060.00317.44
8.1.90.0070.00017.41
8.1.80.0040.00417.44
8.1.70.0000.00817.39
8.1.60.0000.00817.45
8.1.50.0080.00017.56
8.1.40.0040.00417.57
8.1.30.0040.00417.49
8.1.20.0080.00017.55
8.1.10.0000.00717.54
8.1.00.0080.00017.53
8.0.300.0040.00419.86
8.0.290.0040.00417.04
8.0.280.0030.00318.30
8.0.270.0030.00317.07
8.0.260.0060.00016.82
8.0.250.0000.00716.99
8.0.240.0050.00316.97
8.0.230.0070.00016.81
8.0.220.0000.00716.85
8.0.210.0000.00716.89
8.0.200.0000.00616.82
8.0.190.0000.00717.02
8.0.180.0040.00416.86
8.0.170.0040.00416.83
8.0.160.0070.00016.78
8.0.150.0070.00016.92
8.0.140.0050.00516.77
8.0.130.0000.00613.29
8.0.120.0030.00616.88
8.0.110.0040.00416.86
8.0.100.0030.00516.95
8.0.90.0050.00316.77
8.0.80.0060.00916.87
8.0.70.0050.00216.88
8.0.60.0000.00716.85
8.0.50.0000.00716.75
8.0.30.0150.00417.11
8.0.20.0120.00717.40
8.0.10.0020.00517.04
8.0.00.0170.00616.62
7.4.330.0000.00516.82
7.4.320.0000.00716.46
7.4.300.0030.00316.41
7.4.290.0070.00016.45
7.4.280.0000.00716.61
7.4.270.0060.00016.42
7.4.260.0050.00013.21
7.4.250.0020.00516.50
7.4.240.0070.00016.56
7.4.230.0020.00516.48
7.4.220.0030.02516.63
7.4.210.0110.00616.60
7.4.200.0000.00716.68
7.4.190.0000.00716.65
7.4.160.0060.00916.74
7.4.150.0060.01217.40
7.4.140.0080.01017.86
7.4.130.0080.01316.56
7.4.120.0130.00516.45
7.4.110.0120.01216.46
7.4.100.0070.01016.39
7.4.90.0090.00916.56
7.4.80.0040.01619.39
7.4.70.0100.00716.70
7.4.60.0070.01016.55
7.4.50.0030.00516.30
7.4.40.0000.01822.77
7.4.30.0120.00916.43
7.3.330.0050.00013.16
7.3.320.0000.00513.20
7.3.310.0000.00716.15
7.3.300.0000.00616.26
7.3.290.0030.01016.31
7.3.280.0080.00816.28
7.3.270.0110.00717.40
7.3.260.0090.01118.24
7.3.250.0090.01116.26
7.3.240.0150.00416.36
7.3.230.0070.01016.44
7.3.210.0160.00016.48
7.3.200.0040.01519.39
7.3.190.0070.01716.57
7.3.180.0120.00416.23
7.3.170.0140.00716.61
7.3.160.0100.00716.25
7.2.330.0170.00016.61
7.2.320.0090.01216.68
7.2.310.0070.01116.25
7.2.300.0060.00916.49
7.2.290.0030.01316.68
7.2.100.0540.00314.29
7.2.90.0610.01014.14
7.2.80.0170.00714.48
7.2.70.0760.00314.50
7.2.60.0890.00014.74
7.2.50.0610.00914.71
7.2.40.0650.01014.39
7.2.30.0780.00614.62
7.2.20.0670.00314.86
7.2.10.0830.01014.66
7.2.00.0540.01014.79
7.1.220.0680.00313.61
7.1.210.0790.00313.61
7.1.200.0760.00613.61
7.1.190.0310.01013.61
7.1.180.0690.00613.61
7.1.170.0660.00913.63
7.1.160.0420.00613.71
7.1.150.0570.01013.63
7.1.140.0830.00313.62
7.1.130.0790.01113.65
7.1.120.0860.01413.67
7.1.110.0230.00813.67
7.1.100.0840.00613.69
7.1.90.0160.00313.61
7.1.80.0340.00813.61
7.1.70.0640.00313.73
7.1.60.1110.00931.57
7.1.50.0380.00031.77
7.1.40.0510.01131.75
7.1.30.0960.00331.66
7.1.20.0830.00931.49
7.1.10.0140.00513.61
7.1.00.0700.00713.61
7.0.310.0860.00913.61
7.0.300.0770.00913.61
7.0.290.0790.00413.61
7.0.280.0650.01213.63
7.0.270.1270.00913.61
7.0.260.0910.00913.61
7.0.250.1090.00313.64
7.0.240.0310.01113.61
7.0.230.0710.00813.61
7.0.220.0240.01013.61
7.0.210.0460.01013.61
7.0.200.0700.01013.79
7.0.190.0750.01013.61
7.0.180.0580.01113.61
7.0.170.1210.01013.66
7.0.160.0830.01013.61
7.0.150.0170.01113.64
7.0.140.0120.01213.61
7.0.130.0760.01813.69
7.0.120.0810.00613.61
7.0.110.0380.01113.65
7.0.100.0930.00613.61
7.0.90.0840.00613.61
7.0.80.1150.01313.61
7.0.70.0990.01413.61
7.0.60.0190.00813.61
7.0.50.0220.00913.61
7.0.40.0260.01113.63
7.0.30.0130.00913.61
7.0.20.0110.00613.61
7.0.10.1520.00313.61
7.0.00.0220.00613.71
5.6.380.0140.01014.13
5.6.370.0110.01413.79
5.6.360.0110.01114.05
5.6.350.0150.00914.64
5.6.340.0110.00914.55
5.6.330.0050.01214.50
5.6.320.0080.01014.33
5.6.310.0130.00514.23
5.6.300.0170.01314.51
5.6.290.0200.00814.27
5.6.280.0190.00914.15
5.6.270.0140.00814.27
5.6.260.0170.00914.15
5.6.250.0110.01114.49
5.6.240.0080.01514.61
5.6.230.0210.00614.29
5.6.220.0160.00514.24
5.6.210.0200.00414.48
5.6.200.0200.00414.61
5.6.190.0150.00614.26
5.6.180.0180.01114.38
5.6.170.0100.01013.89
5.6.160.0150.00813.88
5.6.150.0120.00414.18
5.6.140.0090.00914.05
5.6.130.0160.00813.91
5.6.120.0080.00913.92
5.6.110.0050.01414.26
5.6.100.0170.00414.04
5.6.90.0030.01514.13
5.6.80.0130.00914.34
5.6.70.0120.00814.01
5.6.60.0080.01314.11
5.6.50.0120.00914.09
5.6.40.0100.01314.08
5.6.30.0070.01014.33
5.6.20.0120.00914.14
5.6.10.0140.01014.29
5.6.00.0150.00614.23
5.5.380.0170.00613.61
5.5.370.0070.01813.61
5.5.360.0080.00813.61
5.5.350.0090.00413.61
5.5.340.0140.00013.61
5.5.330.0120.00913.61
5.5.320.0130.00813.61
5.5.310.0050.00813.61
5.5.300.0180.00613.61
5.5.290.0000.01913.61
5.5.280.0210.01913.61
5.5.270.0100.01013.61
5.5.260.0040.01313.61
5.5.250.0150.00813.61
5.5.240.0000.01913.61
5.5.230.0080.00513.61
5.5.220.0160.00013.61
5.5.210.0040.01613.61
5.5.200.0130.00713.61
5.5.190.0030.01313.61
5.5.180.0080.00813.61
5.5.170.0080.01614.54
5.5.160.0150.00513.61
5.5.150.0220.00313.61
5.5.140.0100.00513.61
5.5.130.0100.00713.61
5.5.120.0100.01013.61
5.5.110.0110.00313.61
5.5.100.0120.00413.61
5.5.90.0080.00513.61
5.5.80.0100.01013.61
5.5.70.0120.00413.61
5.5.60.0090.00913.61
5.5.50.0120.00813.61
5.5.40.0120.00613.61
5.5.30.0160.00613.61
5.5.20.0150.01213.61
5.5.10.0200.01413.61
5.5.00.0180.00213.61
5.4.450.0080.00813.61
5.4.440.0040.00813.61
5.4.430.0060.00613.61
5.4.420.0120.00213.61
5.4.410.0080.00413.61
5.4.400.0070.00713.61
5.4.390.0110.00013.61
5.4.380.0040.00913.61
5.4.370.0060.00613.61
5.4.360.0130.00013.61
5.4.350.0080.00413.61
5.4.340.0130.00013.61
5.4.330.0120.00213.61
5.4.320.0080.00413.61
5.4.310.0040.00813.61
5.4.300.0050.00713.61
5.4.290.0060.00613.61
5.4.280.0120.00013.61
5.4.270.0080.00413.61
5.4.260.0080.00413.61
5.4.250.0080.00513.61
5.4.240.0110.00013.61
5.4.230.0070.00313.61
5.4.220.0110.00013.61
5.4.210.0090.00313.61
5.4.200.0100.00313.61
5.4.190.0080.00413.61
5.4.180.0080.00813.61
5.4.170.0090.00413.61
5.4.160.0060.00613.61
5.4.150.0140.00013.61
5.4.140.0140.00413.61
5.4.130.0080.00513.61
5.4.120.0080.00413.61
5.4.110.0130.00313.61
5.4.100.0060.00613.61
5.4.90.0080.00813.61
5.4.80.0110.00613.61
5.4.70.0090.00813.61
5.4.60.0120.00013.61
5.4.50.0040.00913.61
5.4.40.0040.00813.61
5.4.30.0070.00613.61
5.4.20.0080.00513.61
5.4.10.0040.00913.61
5.4.00.0120.00013.61
5.3.290.0050.00513.61
5.3.280.0000.01013.61
5.3.270.0070.00513.61
5.3.260.0040.00813.61
5.3.250.0000.01113.61
5.3.240.0060.00613.61
5.3.230.0090.00613.61
5.3.220.0080.00813.61
5.3.210.0060.00913.61
5.3.200.0180.00013.61
5.3.190.0150.00013.61
5.3.180.0090.00413.61
5.3.170.0070.00713.61
5.3.160.0040.00713.61
5.3.150.0110.00013.61
5.3.140.0000.01013.61
5.3.130.0070.00713.61
5.3.120.0100.00313.61
5.3.110.0120.00013.61
5.3.100.0000.01113.61
5.3.90.0070.00413.61
5.3.80.0080.00313.61
5.3.70.0030.00913.61
5.3.60.0000.01213.61
5.3.50.0080.00413.61
5.3.40.0090.00313.61
5.3.30.0070.00313.61
5.3.20.0120.00413.61
5.3.10.0120.00613.61
5.3.00.0090.00613.61

preferences:
30.76 ms | 400 KiB | 5 Q