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() { global $numbers; for($j = $numbers[0]; $j <=count($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.0110.00418.79
8.3.30.0030.01018.68
8.3.20.0080.00018.63
8.3.10.0080.00020.81
8.3.00.0040.00421.85
8.2.170.0070.00722.96
8.2.160.0140.00020.31
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0060.00317.50
8.2.110.0040.00720.35
8.2.100.0040.00817.91
8.2.90.0030.00619.36
8.2.80.0040.00417.97
8.2.70.0030.00617.75
8.2.60.0030.00618.05
8.2.50.0040.00418.07
8.2.40.0040.00418.03
8.2.30.0000.00719.35
8.2.20.0000.00817.76
8.2.10.0040.00417.75
8.2.00.0040.00417.77
8.1.270.0070.00322.11
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.50
8.1.230.0110.00020.92
8.1.220.0040.00418.77
8.1.210.0000.00818.90
8.1.200.0060.00317.22
8.1.190.0080.00017.65
8.1.180.0050.00318.10
8.1.170.0050.00318.65
8.1.160.0000.00718.83
8.1.150.0040.00418.68
8.1.140.0000.00717.46
8.1.130.0000.00617.83
8.1.120.0040.00417.46
8.1.110.0040.00417.53
8.1.100.0070.00017.43
8.1.90.0050.00217.36
8.1.80.0000.00817.46
8.1.70.0030.00317.43
8.1.60.0030.01017.59
8.1.50.0040.00417.36
8.1.40.0050.00317.41
8.1.30.0000.00817.67
8.1.20.0000.00817.59
8.1.10.0040.00417.54
8.1.00.0000.00817.44
8.0.300.0070.00020.07
8.0.290.0070.00017.18
8.0.280.0040.00418.51
8.0.270.0030.00317.26
8.0.260.0030.00316.82
8.0.250.0070.00016.87
8.0.240.0040.00416.93
8.0.230.0070.00017.05
8.0.220.0040.00416.89
8.0.210.0030.00316.79
8.0.200.0060.00016.85
8.0.190.0050.00316.88
8.0.180.0080.00016.94
8.0.170.0080.00016.90
8.0.160.0000.00716.95
8.0.150.0030.00516.83
8.0.140.0060.00616.86
8.0.130.0050.00013.26
8.0.120.0070.00016.83
8.0.110.0040.00416.93
8.0.100.0030.00316.88
8.0.90.0000.00816.77
8.0.80.0070.01316.84
8.0.70.0040.00416.89
8.0.60.0050.00316.89
8.0.50.0000.00816.76
8.0.30.0070.01317.20
8.0.20.0080.01017.40
8.0.10.0070.00016.83
8.0.00.0140.00816.52
7.4.330.0030.00316.74
7.4.320.0000.00716.61
7.4.300.0030.00316.50
7.4.290.0000.00716.52
7.4.280.0000.00716.61
7.4.270.0030.00316.46
7.4.260.0030.00313.28
7.4.250.0040.00416.39
7.4.240.0030.00316.60
7.4.230.0040.00416.60
7.4.220.0030.01616.52
7.4.210.0090.00816.59
7.4.200.0000.00716.68
7.4.190.0040.00416.68
7.4.160.0090.00616.37
7.4.150.0090.01117.40
7.4.140.0080.01317.86
7.4.130.0140.00416.47
7.4.120.0100.01016.45
7.4.110.0070.01016.55
7.4.100.0140.00316.59
7.4.90.0070.01316.39
7.4.80.0100.00719.39
7.4.70.0100.01216.38
7.4.60.0100.00616.70
7.4.50.0060.00316.46
7.4.40.0090.00622.77
7.4.30.0120.00916.51
7.4.00.0030.01415.22
7.3.330.0030.00313.28
7.3.320.0000.00513.18
7.3.310.0040.00416.34
7.3.300.0040.00416.37
7.3.290.0000.01416.49
7.3.280.0070.00916.33
7.3.270.0100.01317.40
7.3.260.0140.00918.24
7.3.250.0110.00716.40
7.3.240.0100.00716.64
7.3.230.0100.00716.39
7.3.210.0130.01716.62
7.3.200.0100.00719.39
7.3.190.0150.00416.65
7.3.180.0100.00616.34
7.3.170.0100.01316.62
7.3.160.0130.00316.52
7.3.120.0000.01715.08
7.2.330.0070.01016.93
7.2.320.0110.01116.51
7.2.310.0070.01116.69
7.2.300.0100.00716.71
7.2.290.0120.00916.56
7.2.00.0060.00919.47
7.1.100.0080.00318.40
7.1.70.0100.00717.18
7.1.60.0060.01919.40
7.1.50.0140.01016.77
7.1.00.0030.06722.50
7.0.200.0050.00316.63
7.0.140.0030.07022.04
7.0.70.0070.03721.75
7.0.60.0030.05021.77
7.0.50.0070.03722.12
7.0.40.0070.05720.18
7.0.30.0030.04020.05
7.0.20.0000.05020.05
7.0.10.0030.04320.12
7.0.00.0030.04320.09
5.6.220.0000.04320.71
5.6.210.0000.04320.49
5.6.200.0030.04020.97
5.6.190.0030.05321.04
5.6.180.0030.05721.02
5.6.170.0030.04020.93
5.6.160.0030.04021.02
5.6.150.0070.03721.02
5.6.140.0000.04321.05
5.6.130.0070.03721.18
5.6.120.0000.04321.03
5.6.110.0000.04721.05
5.6.100.0070.04020.91
5.6.90.0030.04021.00
5.6.80.0030.04020.43
5.6.70.0030.07320.33
5.6.60.0030.03720.43
5.6.50.0000.04020.41
5.6.40.0030.06720.47
5.6.30.0030.08720.39
5.6.20.0070.07720.41
5.6.10.0030.07020.36
5.6.00.0100.07720.46
5.5.360.0000.04720.41
5.5.350.0030.04020.42
5.5.340.0070.04320.74
5.5.330.0000.07320.78
5.5.320.0070.03720.81
5.5.310.0070.03720.90
5.5.300.0030.05020.91
5.5.290.0100.03320.91
5.5.280.0070.04020.64
5.5.270.0030.07020.73
5.5.260.0070.03720.92
5.5.250.0000.05320.68
5.5.240.0000.04720.27
5.5.230.0070.03720.27
5.5.220.0000.05320.17
5.5.210.0000.04020.20
5.5.200.0000.07320.23
5.5.190.0030.08320.23
5.5.180.0030.08320.24
5.5.160.0030.07720.22
5.5.150.0030.07720.27
5.5.140.0030.07720.22
5.5.130.0100.07720.25
5.5.120.0030.08320.21
5.5.110.0070.08320.14
5.5.100.0100.08020.08
5.5.90.0100.07020.07
5.5.80.0130.07320.07
5.5.70.0030.04720.11
5.5.60.0100.06720.06
5.5.50.0030.06320.15
5.5.40.0030.07720.01
5.5.30.0030.06020.03
5.5.20.0070.04320.06
5.5.10.0070.07720.11
5.5.00.0030.07720.12
5.4.450.0070.05019.27
5.4.440.0030.04019.53
5.4.430.0000.04019.46
5.4.420.0070.05719.45
5.4.410.0030.03719.43
5.4.400.0030.03318.95
5.4.390.0030.03718.90
5.4.380.0100.03018.91
5.4.370.0070.05319.04
5.4.360.0030.03718.88
5.4.350.0070.06018.90
5.4.340.0130.07319.05
5.4.320.0070.07318.95
5.4.310.0030.08019.04
5.4.300.0000.08019.09
5.4.290.0070.04719.03
5.4.280.0030.06319.03
5.4.270.0030.08019.09
5.4.260.0070.07019.21
5.4.250.0030.08019.20
5.4.240.0030.07718.85
5.4.230.0000.04719.04
5.4.220.0030.05718.89
5.4.210.0030.07719.03
5.4.200.0100.05019.13
5.4.190.0070.07719.08
5.4.180.0030.04319.11
5.4.170.0030.06318.83
5.4.160.0070.04719.01
5.4.150.0070.06719.01
5.4.140.0030.08016.45
5.4.130.0100.06316.45
5.4.120.0070.07016.33
5.4.110.0000.06716.47
5.4.100.0070.07316.36
5.4.90.0070.07016.44
5.4.80.0100.05716.47
5.4.70.0030.06316.43
5.4.60.0070.05716.30
5.4.50.0100.07016.40
5.4.40.0070.07316.38
5.4.30.0100.06716.45
5.4.20.0000.04016.45
5.4.10.0070.07016.44
5.4.00.0000.05015.95
5.3.290.0070.07715.85
5.3.280.0030.07315.85
5.3.270.0100.06715.85
5.3.260.0000.04015.85
5.3.250.0070.05015.85
5.3.240.0030.08015.85
5.3.230.0000.08315.85
5.3.220.0070.07715.85
5.3.210.0000.08015.85
5.3.200.0000.06015.85
5.3.190.0070.05715.85
5.3.180.0070.06315.85
5.3.170.0070.04715.85
5.3.160.0030.07015.85
5.3.150.0030.06315.85
5.3.140.0000.08015.85
5.3.130.0070.07715.85
5.3.120.0030.05015.85
5.3.110.0000.07015.85
5.3.100.0070.07315.85
5.3.90.0030.05715.85
5.3.80.0070.07715.85
5.3.70.0100.05315.85
5.3.60.0000.07315.85
5.3.50.0000.05015.85
5.3.40.0130.05715.85
5.3.30.0070.07015.85
5.3.20.0030.05315.85
5.3.10.0000.08015.85
5.3.00.0000.07715.85
5.2.170.0070.04715.85
5.2.160.0000.06015.85
5.2.150.0030.06315.85
5.2.140.0030.06015.85
5.2.130.0030.06315.85
5.2.120.0000.05315.85
5.2.110.0100.05315.85
5.2.100.0000.06715.85
5.2.90.0030.04315.85
5.2.80.0030.06015.85
5.2.70.0070.05715.85
5.2.60.0030.05715.85
5.2.50.0030.06015.85
5.2.40.0030.05715.85
5.2.30.0000.06015.85
5.2.20.0100.05315.85
5.2.10.0030.05015.85
5.2.00.0070.06015.85
5.1.60.0030.05315.85
5.1.50.0030.05015.85
5.1.40.0070.05015.85
5.1.30.0000.06315.85
5.1.20.0000.05715.85
5.1.10.0030.05315.85
5.1.00.0130.05015.85
5.0.50.0000.05015.85
5.0.40.0000.04015.85
5.0.30.0000.07015.85
5.0.20.0030.03315.85
5.0.10.0070.04315.85
5.0.00.0030.06715.85
4.4.90.0100.01715.85
4.4.80.0000.03715.85
4.4.70.0030.03715.85
4.4.60.0000.03315.85
4.4.50.0000.03715.85
4.4.40.0000.05715.85
4.4.30.0070.03315.85
4.4.20.0030.02315.85
4.4.10.0030.03315.85
4.4.00.0000.05715.85
4.3.110.0000.03715.85
4.3.100.0030.02715.85
4.3.90.0070.02315.85
4.3.80.0000.05315.85
4.3.70.0000.03315.85
4.3.60.0000.02715.85
4.3.50.0000.03715.85
4.3.40.0070.04315.85
4.3.30.0030.03315.85
4.3.20.0000.02715.85
4.3.10.0030.03315.85
4.3.00.0070.03015.85

preferences:
46.22 ms | 400 KiB | 5 Q