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 == 999); $x += 2) { $cmd = (yield $ary[$x]); // yield expr if ($cmd == 999) { $x = 999; } } } $gen = nums(); foreach ($gen as $value) { echo "$value\n"; if ($value == 28) { // don't let it get to 32 $gen->send(999); } }

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.0120.00316.63
8.3.50.0240.00721.94
8.3.40.0070.00718.79
8.3.30.0040.01419.19
8.3.20.0080.00020.33
8.3.10.0050.00223.71
8.3.00.0040.00420.77
8.2.180.0070.00718.16
8.2.170.0140.00722.96
8.2.160.0130.00422.25
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00022.08
8.2.110.0080.00022.25
8.2.100.0070.00417.72
8.2.90.0080.00019.26
8.2.80.0000.00817.97
8.2.70.0070.00317.63
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0030.00618.09
8.2.30.0000.00718.02
8.2.20.0040.00417.74
8.2.10.0000.00717.82
8.2.00.0000.00717.79
8.1.280.0100.01025.92
8.1.270.0050.00324.02
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0060.00323.91
8.1.230.0000.01219.04
8.1.220.0030.00517.79
8.1.210.0030.00518.77
8.1.200.0000.00817.35
8.1.190.0030.00617.53
8.1.180.0040.00418.10
8.1.170.0030.00618.50
8.1.160.0070.00322.07
8.1.150.0030.00618.64
8.1.140.0040.00417.51
8.1.130.0000.00717.81
8.1.120.0000.00717.49
8.1.110.0050.00217.36
8.1.100.0040.00417.45
8.1.90.0040.00417.50
8.1.80.0000.00817.46
8.1.70.0050.00217.34
8.1.60.0070.00417.59
8.1.50.0000.00817.61
8.1.40.0040.00417.58
8.1.30.0060.00317.46
8.1.20.0040.00417.57
8.1.10.0050.00317.53
8.1.00.0000.00817.50
8.0.300.0070.00018.77
8.0.290.0000.00717.18
8.0.280.0000.00718.43
8.0.270.0000.00717.22
8.0.260.0000.00616.84
8.0.250.0000.00817.01
8.0.240.0070.00016.95
8.0.230.0000.00716.92
8.0.220.0040.00416.89
8.0.210.0030.00316.81
8.0.200.0000.00616.96
8.0.190.0070.00016.97
8.0.180.0000.00716.82
8.0.170.0000.00716.91
8.0.160.0000.00716.93
8.0.150.0040.00416.78
8.0.140.0000.00816.88
8.0.130.0000.00513.33
8.0.120.0040.00416.80
8.0.110.0040.00416.77
8.0.100.0080.00016.76
8.0.90.0060.00316.79
8.0.80.0090.00916.86
8.0.70.0040.00416.80
8.0.60.0000.00716.77
8.0.50.0000.00716.92
8.0.30.0110.00817.22
8.0.20.0090.00917.40
8.0.10.0040.00416.84
8.0.00.0130.00516.87
7.4.330.0050.00015.00
7.4.320.0000.00616.63
7.4.300.0030.00316.53
7.4.290.0050.00516.67
7.4.280.0070.00016.62
7.4.270.0030.00316.60
7.4.260.0030.00316.50
7.4.250.0030.00516.50
7.4.240.0020.00516.51
7.4.230.0040.00316.61
7.4.220.0040.01516.48
7.4.210.0080.00716.54
7.4.200.0080.00016.71
7.4.190.0000.00816.48
7.4.160.0080.00816.45
7.4.150.0090.00917.40
7.4.140.0060.01117.86
7.4.130.0100.00716.57
7.4.120.0050.01216.38
7.4.110.0110.00516.59
7.4.100.0150.00816.65
7.4.90.0090.01316.43
7.4.80.0100.00616.34
7.4.70.0080.00816.54
7.4.60.0080.00816.58
7.4.50.0030.00316.41
7.4.40.0140.00322.77
7.4.30.0040.01116.39
7.4.00.0110.00415.13
7.3.330.0000.00513.32
7.3.320.0050.00313.27
7.3.310.0030.00316.21
7.3.300.0030.00316.31
7.3.290.0060.00916.38
7.3.280.0150.00416.33
7.3.270.0080.00817.40
7.3.260.0160.01016.54
7.3.250.0100.00816.45
7.3.240.0130.00716.37
7.3.230.0030.01816.39
7.3.210.0030.01316.60
7.3.200.0110.00819.39
7.3.190.0090.00916.64
7.3.180.0100.00616.64
7.3.170.0100.00716.46
7.3.160.0160.00016.32
7.3.120.0080.00615.15
7.2.330.0030.01616.50
7.2.320.0140.00316.79
7.2.310.0130.00316.75
7.2.300.0090.01416.54
7.2.290.0100.00716.47
7.2.00.0030.00719.29
7.1.100.0000.01317.76
7.1.70.0040.00717.29
7.1.60.0070.01719.29
7.1.50.0110.01116.68
7.1.00.0000.08022.57
7.0.200.0000.01016.53
7.0.140.0000.07722.09
7.0.60.0000.08719.91
7.0.50.0100.04317.89
7.0.40.0100.04720.20
7.0.30.0270.04320.06
7.0.20.0230.08020.07
7.0.10.0100.08320.15
7.0.00.0070.09020.16
5.6.280.0070.07020.99
5.6.210.0070.07320.49
5.6.200.0030.07318.17
5.6.190.0100.08320.61
5.6.180.4030.03320.64
5.6.170.0230.05020.44
5.6.160.0100.06720.57
5.6.150.0100.07318.19
5.6.140.0030.08718.26
5.6.130.0100.04318.18
5.6.120.0030.06720.99
5.6.110.0100.04020.86
5.6.100.0030.04721.09
5.6.90.0070.07721.11
5.6.80.0100.04320.45
5.6.70.4530.03320.51
5.5.350.0300.05720.41
5.5.340.0200.06717.96
5.5.330.0100.06020.14
5.5.320.0270.05320.31
5.5.310.0270.06320.51
5.5.300.0200.05017.90
5.5.290.0070.08017.95
5.5.280.0100.08320.65
5.5.270.0100.08320.88
5.5.260.0030.04320.87
5.5.250.0070.06720.77
5.5.240.0170.04320.26
5.4.450.0130.05719.63
5.4.440.0170.05719.53
5.4.430.0330.07019.53
5.4.420.0300.07319.21
5.4.410.0300.05318.95
5.4.400.1070.04718.77
5.4.390.1330.06018.62
5.4.380.0100.05718.74
5.4.370.0130.05318.75
5.4.360.0130.05318.77
5.4.350.0200.04718.74
5.4.340.0130.05718.47
5.4.320.0050.03912.52
5.4.310.0040.04312.52
5.4.300.0070.03612.52
5.4.290.0050.04612.51
5.4.280.0060.04112.41
5.4.270.0080.04312.41
5.4.260.0090.04312.41
5.4.250.0050.04112.41
5.4.240.0070.03512.41
5.4.230.0060.03912.40
5.4.220.0190.04612.39
5.4.210.0150.04512.39
5.4.200.0140.04512.39
5.4.190.0130.04812.38
5.4.180.0410.08012.38
5.4.170.0130.04812.39
5.4.160.0110.04712.39
5.4.150.0210.04112.38
5.4.140.0190.04212.08
5.4.130.0150.04312.05
5.4.120.0160.04712.02
5.4.110.0130.04612.02
5.4.100.0190.04712.02
5.4.90.0130.04812.02
5.4.80.0290.09412.02
5.4.70.0130.04712.01
5.4.60.0190.04012.01
5.4.50.0450.07112.01
5.4.40.0130.04312.00
5.4.30.0140.04411.99
5.4.20.0170.04011.99
5.4.10.0110.04512.00
5.4.00.0100.04511.48
5.3.290.0080.04012.80
5.3.280.0020.04212.71
5.3.270.0190.04012.72
5.3.260.0160.04312.72
5.3.250.0200.03912.72
5.3.240.0150.04612.71
5.3.230.0150.04612.71
5.3.220.0360.08312.68
5.3.210.0150.04912.68
5.3.200.0160.04312.68
5.3.190.0190.04312.68
5.3.180.0120.04712.67
5.3.170.0150.04512.67
5.3.160.0180.04412.68
5.3.150.0150.04412.68
5.3.140.0220.06812.66
5.3.130.0170.04612.66
5.3.120.0150.04712.66
5.3.110.0390.05512.66
5.3.100.0290.09512.12
5.3.90.0180.04112.08
5.3.80.0280.09212.07
5.3.70.0270.09612.08
5.3.60.0220.09912.07
5.3.50.0460.10712.00
5.3.40.0410.08112.00
5.3.30.0180.04311.96
5.3.20.0280.09211.75
5.3.10.0270.09011.71
5.3.00.0160.04011.69
5.2.170.0180.0329.20
5.2.160.0300.0829.20
5.2.150.0330.0819.20
5.2.140.0180.0329.20
5.2.130.0130.0359.16
5.2.120.0300.0779.16
5.2.110.0200.0899.16
5.2.100.0120.0369.16
5.2.90.0260.0849.15
5.2.80.0170.0349.14
5.2.70.0270.0819.14
5.2.60.0260.0839.11
5.2.50.0120.0369.07
5.2.40.0270.0839.05
5.2.30.0130.0339.02
5.2.20.0130.0369.02
5.2.10.0110.0368.92
5.2.00.0230.0538.77
5.1.60.0340.0688.06
5.1.50.0120.0308.06
5.1.40.0160.0838.05
5.1.30.0290.0728.39
5.1.20.0100.0318.43
5.1.10.0370.0678.14
5.1.00.0250.0768.14
5.0.50.0080.0256.61
5.0.40.0110.0216.47
5.0.30.0240.0806.29
5.0.20.0330.0636.26
5.0.10.0080.0236.23
5.0.00.0180.0896.22
4.4.90.0110.0144.78
4.4.80.0230.0624.76
4.4.70.0060.0204.75
4.4.60.0100.0154.75
4.4.50.0250.0634.77
4.4.40.0070.0304.71
4.4.30.0070.0184.76
4.4.20.0050.0214.85
4.4.10.0090.0174.85
4.4.00.0130.0834.75
4.3.110.0050.0194.67
4.3.100.0080.0184.66
4.3.90.0090.0164.63
4.3.80.0030.0314.58
4.3.70.0310.0574.63
4.3.60.0060.0234.63
4.3.50.0080.0174.63
4.3.40.0230.0734.54
4.3.30.0070.0183.30
4.3.20.0040.0193.28
4.3.10.0110.0443.24
4.3.00.0000.0236.57

preferences:
39.03 ms | 401 KiB | 5 Q