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

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.0040.01118.76
8.3.30.0100.00720.08
8.3.20.0060.00318.85
8.3.10.0050.00320.96
8.3.00.0000.00822.43
8.2.170.0090.00622.96
8.2.160.0200.00020.58
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00020.95
8.2.110.0060.00319.43
8.2.100.0120.00017.91
8.2.90.0000.00819.30
8.2.80.0040.00419.31
8.2.70.0060.00317.63
8.2.60.0050.00318.03
8.2.50.0040.00418.07
8.2.40.0050.00318.30
8.2.30.0000.00719.45
8.2.20.0000.00717.71
8.2.10.0050.00217.61
8.2.00.0080.00017.83
8.1.270.0000.00823.99
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0090.00022.45
8.1.230.0120.00020.84
8.1.220.0000.00918.77
8.1.210.0040.00418.97
8.1.200.0060.00317.35
8.1.190.0040.00417.53
8.1.180.0080.00018.10
8.1.170.0000.00818.59
8.1.160.0040.00418.88
8.1.150.0040.00418.54
8.1.140.0040.00417.47
8.1.130.0000.00717.77
8.1.120.0060.00317.44
8.1.110.0000.00717.45
8.1.100.0040.00417.41
8.1.90.0070.00017.36
8.1.80.0040.00417.51
8.1.70.0030.00317.42
8.1.60.0040.00417.56
8.1.50.0000.00717.41
8.1.40.0030.00617.41
8.1.30.0050.00317.59
8.1.20.0030.00517.54
8.1.10.0040.00417.46
8.1.00.0030.00617.48
8.0.300.0030.00520.04
8.0.290.0040.00417.16
8.0.280.0030.00318.44
8.0.270.0000.00717.16
8.0.260.0000.00616.71
8.0.250.0000.00716.93
8.0.240.0100.00016.94
8.0.230.0000.00716.96
8.0.220.0000.00716.94
8.0.210.0000.00816.74
8.0.200.0000.00616.91
8.0.190.0040.00416.95
8.0.180.0040.00416.82
8.0.170.0030.00516.83
8.0.160.0030.00316.81
8.0.150.0000.00716.85
8.0.140.0060.00616.82
8.0.130.0000.00613.27
8.0.120.0080.00016.86
8.0.110.0070.00016.84
8.0.100.0070.00016.92
8.0.90.0030.00416.77
8.0.80.0110.00616.91
8.0.70.0030.00516.76
8.0.60.0000.00716.91
8.0.50.0040.00416.91
8.0.30.0120.00916.89
8.0.20.0090.01017.43
8.0.10.0040.00417.07
8.0.00.0080.01116.82
7.4.330.0030.00316.79
7.4.320.0060.00016.60
7.4.300.0000.00616.41
7.4.290.0000.00716.43
7.4.280.0070.00016.35
7.4.270.0030.00316.57
7.4.260.0000.00513.25
7.4.250.0040.00316.45
7.4.240.0000.00716.64
7.4.230.0070.00016.66
7.4.220.0130.00616.61
7.4.210.0090.00616.42
7.4.200.0030.00316.30
7.4.190.0070.00016.65
7.4.160.0040.01316.42
7.4.150.0150.00317.40
7.4.140.0090.00917.86
7.4.130.0120.00816.53
7.4.120.0070.01216.55
7.4.110.0140.00316.65
7.4.100.0060.00916.32
7.4.90.0140.01016.49
7.4.80.0110.01419.39
7.4.70.0100.00716.56
7.4.60.0040.01416.66
7.4.50.0030.00316.38
7.4.40.0000.01722.77
7.4.30.0030.01416.57
7.4.00.0000.01514.85
7.3.330.0050.00013.24
7.3.320.0050.00013.30
7.3.310.0070.00016.13
7.3.300.0000.00716.31
7.3.290.0100.00316.27
7.3.280.0080.00916.28
7.3.270.0110.00717.40
7.3.260.0050.01418.24
7.3.250.0070.01016.48
7.3.240.0100.00716.32
7.3.230.0060.01116.66
7.3.210.0110.00616.59
7.3.200.0100.01119.39
7.3.190.0120.00916.66
7.3.180.0130.00316.37
7.3.170.0120.00316.45
7.3.160.0050.01016.38
7.3.120.0070.01014.86
7.3.00.0030.00616.67
7.2.330.0060.01216.71
7.2.320.0090.01316.75
7.2.310.0120.00916.58
7.2.300.0130.00716.88
7.2.290.0130.00316.77
7.2.130.0100.00017.02
7.2.120.0130.00917.02
7.2.110.0160.00017.00
7.2.100.0110.00416.78
7.2.90.0070.01116.98
7.2.80.0090.00916.98
7.2.70.0110.00717.02
7.2.60.0120.00516.95
7.2.50.0040.01716.98
7.2.40.0040.01616.97
7.2.30.0200.00017.02
7.2.20.0120.00917.06
7.2.10.0160.01416.98
7.2.00.0070.00918.12
7.1.250.0000.01415.68
7.1.240.0140.00415.86
7.1.230.0120.00915.75
7.1.220.0130.00415.77
7.1.210.0060.01415.57
7.1.200.0060.00715.78
7.1.190.0030.01115.86
7.1.180.0100.01015.98
7.1.170.0090.00915.83
7.1.160.0150.00715.91
7.1.150.0120.00915.84
7.1.140.0050.01515.71
7.1.130.0070.00915.98
7.1.120.0060.01015.75
7.1.110.0160.00015.85
7.1.100.0070.00917.00
7.1.90.0080.00815.89
7.1.80.0110.00415.88
7.1.70.0020.01016.41
7.1.60.0090.00917.48
7.1.50.0120.01425.20
7.1.40.0030.00815.85
7.1.30.0090.00515.83
7.1.20.0080.00415.52
7.1.10.0000.01015.52
7.1.00.0000.03619.03
7.0.330.0070.00715.36
7.0.320.0080.00815.41
7.0.310.0070.01415.39
7.0.300.0090.00915.41
7.0.290.0160.00815.47
7.0.280.0100.01015.57
7.0.270.0180.00915.33
7.0.260.0120.01215.35
7.0.250.0150.00815.58
7.0.240.0130.01315.54
7.0.230.0090.01315.39
7.0.220.0120.00615.11
7.0.210.0060.00815.27
7.0.200.0050.00815.96
7.0.190.0120.00615.25
7.0.180.0080.00315.45
7.0.170.0070.01015.42
7.0.160.0170.00015.31
7.0.150.0120.00015.56
7.0.140.0050.03918.82
7.0.130.0030.00715.36
7.0.120.0070.00315.51
7.0.110.0100.00015.39
7.0.100.0060.04517.65
7.0.90.0050.05017.71
7.0.80.0120.03717.55
7.0.70.0100.03817.68
7.0.60.0100.03817.70
7.0.50.0050.04017.98
7.0.40.0100.04216.88
7.0.30.0100.02616.64
7.0.20.0050.04116.75
7.0.10.0080.03016.71
7.0.00.0040.04416.84
5.6.380.0050.01014.69
5.6.370.0110.00314.52
5.6.360.0100.00314.34
5.6.350.0120.00014.66
5.6.340.0110.00414.18
5.6.330.0080.01314.13
5.6.320.0030.01214.28
5.6.310.0100.00714.63
5.6.300.0030.00914.30
5.6.290.0040.00714.61
5.6.280.0020.04117.57
5.6.270.0030.01314.68
5.6.260.0090.00614.46
5.6.250.0100.04417.46
5.6.240.0100.03317.61
5.6.230.0090.04217.66
5.6.220.0120.04017.50
5.6.210.0100.04417.52
5.6.200.0070.03917.70
5.6.190.0080.03817.57
5.6.180.0090.04017.68
5.6.170.0120.03217.66
5.6.160.0130.03717.70
5.6.150.0060.04317.75
5.6.140.0080.03917.66
5.6.130.0130.02517.60
5.6.120.0070.02917.89
5.6.110.0120.03817.62
5.6.100.0100.04317.84
5.6.90.0020.05017.75
5.6.80.0060.04117.34
5.6.70.0030.04017.42
5.6.60.0080.04217.34
5.6.50.0080.03017.42
5.6.40.0110.03417.29
5.6.30.0100.03817.31
5.6.20.0150.02517.26
5.6.10.0030.03517.27
5.6.00.0030.04317.40
5.5.380.0120.03915.87
5.5.370.0050.04515.86
5.5.360.0030.04115.62
5.5.350.0040.04915.85
5.5.340.0050.04016.15
5.5.330.0070.03016.12
5.5.320.0100.03816.04
5.5.310.0030.04716.13
5.5.300.0090.03215.92
5.5.290.0110.03515.95
5.5.280.0030.02816.17
5.5.270.0050.03215.88
5.5.260.0060.03415.90
5.5.250.0110.03815.95
5.5.240.0000.04715.69
5.5.230.0050.04015.77
5.5.220.0080.04115.69
5.5.210.0050.04015.65
5.5.200.0060.04115.76
5.5.190.0060.03815.79
5.5.180.0120.02715.60
5.5.170.0060.00610.78
5.5.160.0050.04015.74
5.5.150.0070.04115.72
5.5.140.0110.03515.81
5.5.130.0030.03015.68
5.5.120.0070.02715.67
5.5.110.0050.03215.52
5.5.100.0050.03915.74
5.5.90.0060.04115.66
5.5.80.0020.04015.57
5.5.70.0080.04015.74
5.5.60.0020.04315.47
5.5.50.0080.03315.78
5.5.40.0050.04015.50
5.5.30.0080.04115.57
5.5.20.0030.04215.76
5.5.10.0080.04315.63
5.5.00.0030.04515.45
5.4.450.0070.04515.24
5.4.440.0070.03815.05
5.4.430.0030.04515.04
5.4.420.0070.03015.18
5.4.410.0120.03314.86
5.4.400.0080.03515.02
5.4.390.0050.04014.66
5.4.380.0050.04014.86
5.4.370.0080.03914.94
5.4.360.0020.03614.77
5.4.350.0120.03314.97
5.4.340.0160.04014.94
5.4.330.0100.00310.75
5.4.320.0040.04215.02
5.4.310.0120.03714.66
5.4.300.0050.04315.06
5.4.290.0090.03214.98
5.4.280.0050.03514.87
5.4.270.0060.04014.85
5.4.260.0100.01814.96
5.4.250.0030.04115.04
5.4.240.0040.04015.00
5.4.230.0100.02214.91
5.4.220.0050.03814.96
5.4.210.0070.03714.97
5.4.200.0030.04014.90
5.4.190.0030.03914.77
5.4.180.0070.03814.94
5.4.170.0070.03915.05
5.4.160.0050.03814.98
5.4.150.0030.02714.70
5.4.140.0070.03513.81
5.4.130.0040.02913.62
5.4.120.0020.04213.63
5.4.110.0070.04013.69
5.4.100.0030.03513.70
5.4.90.0090.03613.52
5.4.80.0090.03513.48
5.4.70.0000.04213.50
5.4.60.0090.03713.56
5.4.50.0070.03013.53
5.4.40.0050.03213.59
5.4.30.0080.03513.54
5.4.20.0100.03713.70
5.4.10.0070.04113.66
5.4.00.0050.03513.22
5.3.290.0050.03912.44
5.3.280.0020.03712.46
5.3.270.0050.04012.39
5.3.260.0020.04312.43
5.3.250.0030.04012.53
5.3.240.0070.03812.30
5.3.230.0080.04012.34
5.3.220.0030.04312.36
5.3.210.0070.03512.48
5.3.200.0100.03712.40
5.3.190.0040.04312.45
5.3.180.0070.03312.46
5.3.170.0050.02212.45
5.3.160.0030.04012.36
5.3.150.0030.04512.39
5.3.140.0080.03612.34
5.3.130.0050.04112.35
5.3.120.0040.03012.38
5.3.110.0030.03012.37
5.3.100.0000.04212.15
5.3.90.0030.02512.19
5.3.80.0070.03712.16
5.3.70.0030.04212.02
5.3.60.0080.03712.21
5.3.50.0070.03012.13
5.3.40.0050.04212.08
5.3.30.0080.03611.97
5.3.20.0080.03811.95
5.3.10.0040.04111.92
5.3.00.0000.03311.89
5.2.170.0040.03210.95
5.2.160.0030.03510.95
5.2.150.0040.02811.02
5.2.140.0030.03110.95
5.2.130.0050.01710.95
5.2.120.0060.03210.95
5.2.110.0060.03010.95
5.2.100.0030.03310.95
5.2.90.0020.03410.95
5.2.80.0050.03110.95
5.2.70.0080.02810.95
5.2.60.0070.03010.95
5.2.50.0020.03210.95
5.2.40.0050.03010.95
5.2.30.0040.02210.95
5.2.20.0030.03610.95
5.2.10.0040.03010.95
5.2.00.0050.02510.95
5.1.60.0030.02910.95
5.1.50.0060.02510.95
5.1.40.0050.02510.95
5.1.30.0070.02210.95
5.1.20.0060.02810.95
5.1.10.0030.03010.95
5.1.00.0030.03010.95
5.0.50.0030.01810.95
5.0.40.0020.02510.95
5.0.30.0000.03510.95
5.0.20.0000.02610.95
5.0.10.0060.01510.95
5.0.00.0030.03210.95
4.4.90.0020.02110.95
4.4.80.0030.01310.95
4.4.70.0000.02010.95
4.4.60.0030.01510.95
4.4.50.0070.01510.95
4.4.40.0040.02710.95
4.4.30.0000.02410.95
4.4.20.0040.01010.95
4.4.10.0020.02010.95
4.4.00.0020.01710.95
4.3.110.0070.01310.95
4.3.100.0030.01810.95
4.3.90.0000.01710.95
4.3.80.0020.02710.95
4.3.70.0050.01710.95
4.3.60.0040.01710.95
4.3.50.0030.01810.95
4.3.40.0060.02510.95
4.3.30.0020.01810.95
4.3.20.0020.01810.95
4.3.10.0040.01810.95
4.3.00.0020.01910.95

preferences:
43.2 ms | 400 KiB | 5 Q