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,$times=0, $max = count($ary); $x < $max; $x += 2,$times++) { $cmd = (yield $ary[$x]); // yield expr var_dump($cmd,$times); if ($cmd == 'stop') { echo 'Stop the generator?',"\n"; } } echo "Generator ran its course and is closed","\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.70.0040.01116.63
8.3.60.0140.00318.33
8.3.50.0090.00721.20
8.3.40.0000.01418.81
8.3.30.0110.00720.34
8.3.20.0040.00418.77
8.3.10.0040.00421.09
8.3.00.0000.00822.37
8.2.180.0100.01016.32
8.2.170.0110.00422.96
8.2.160.0070.00720.35
8.2.150.0000.00824.18
8.2.140.0030.00624.66
8.2.130.0080.00026.16
8.2.120.0040.00419.76
8.2.110.0060.00319.12
8.2.100.0090.00317.55
8.2.90.0080.00019.34
8.2.80.0080.00018.04
8.2.70.0050.00317.50
8.2.60.0080.00018.03
8.2.50.0080.00018.07
8.2.40.0050.00318.15
8.2.30.0070.00319.44
8.2.20.0000.00717.70
8.2.10.0040.00417.70
8.2.00.0000.00817.63
8.1.280.0140.00725.92
8.1.270.0000.00823.99
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00323.91
8.1.230.0090.00321.04
8.1.220.0040.00418.77
8.1.210.0060.00319.02
8.1.200.0000.00917.38
8.1.190.0000.00717.53
8.1.180.0030.00618.10
8.1.170.0030.00618.63
8.1.160.0000.00818.81
8.1.150.0030.00618.69
8.1.140.0040.00417.41
8.1.130.0000.00717.84
8.1.120.0030.00717.45
8.1.110.0040.00417.52
8.1.100.0050.00317.43
8.1.90.0080.00017.47
8.1.80.0000.00817.36
8.1.70.0070.00017.46
8.1.60.0040.00417.45
8.1.50.0050.00217.50
8.1.40.0040.00417.44
8.1.30.0040.00417.53
8.1.20.0040.00417.62
8.1.10.0000.00717.54
8.1.00.0040.00417.53
8.0.300.0040.00419.85
8.0.290.0070.00017.18
8.0.280.0000.00818.38
8.0.270.0000.00717.27
8.0.260.0030.00316.91
8.0.250.0070.00016.85
8.0.240.0060.00316.90
8.0.230.0000.00816.85
8.0.220.0000.00716.80
8.0.210.0070.00016.94
8.0.200.0030.00316.85
8.0.190.0000.00816.84
8.0.180.0050.00216.78
8.0.170.0040.00416.83
8.0.160.0040.00416.81
8.0.150.0030.00316.82
8.0.140.0040.00416.92
8.0.130.0000.00613.33
8.0.120.0080.00016.82
8.0.110.0050.00316.90
8.0.100.0000.00716.93
8.0.90.0030.00516.96
8.0.80.0030.01716.84
8.0.70.0000.00816.77
8.0.60.0040.00416.73
8.0.50.0070.00017.02
8.0.30.0160.00316.99
8.0.20.0140.00917.42
8.0.10.0070.00016.82
8.0.00.0130.00716.59
7.4.330.0000.00616.71
7.4.320.0060.00016.53
7.4.300.0000.00616.60
7.4.290.0050.00216.57
7.4.280.0060.00316.41
7.4.270.0030.00316.52
7.4.260.0050.00013.26
7.4.250.0050.00216.45
7.4.240.0000.00816.60
7.4.230.0000.00716.71
7.4.220.0160.01016.46
7.4.210.0090.00716.53
7.4.200.0000.00716.32
7.4.190.0000.00716.52
7.4.160.0090.00616.31
7.4.150.0170.00317.40
7.4.140.0120.00617.86
7.4.130.0090.00816.46
7.4.120.0080.00916.53
7.4.110.0070.01116.50
7.4.100.0150.00616.37
7.4.90.0090.00916.48
7.4.80.0000.01919.39
7.4.70.0120.00616.57
7.4.60.0090.00616.43
7.4.50.0060.00316.30
7.4.40.0070.00422.77
7.4.30.0040.01316.69
7.4.00.0100.00615.02
7.3.330.0050.00013.18
7.3.320.0050.00013.21
7.3.310.0000.00716.34
7.3.300.0000.00816.20
7.3.290.0040.01116.36
7.3.280.0030.01216.29
7.3.270.0040.01417.40
7.3.260.0150.00518.24
7.3.250.0130.00416.56
7.3.240.0100.01016.39
7.3.230.0100.00716.39
7.3.210.0030.01416.60
7.3.200.0120.00619.39
7.3.190.0060.01016.33
7.3.180.0120.00416.60
7.3.170.0080.00816.54
7.3.160.0120.00316.54
7.3.120.0120.00414.95
7.2.330.0040.01316.61
7.2.320.0070.01316.66
7.2.310.0080.00816.82
7.2.300.0100.00716.72
7.2.290.0130.00316.76
7.2.00.0070.00719.46
7.1.100.0040.00718.27
7.1.70.0050.00517.16
7.1.60.0100.01419.17
7.1.50.0130.01017.10
7.1.00.0000.03722.33
7.0.200.0000.01016.88
7.0.140.0000.08022.00
7.0.70.0100.04719.96
7.0.60.0070.03721.82
7.0.50.0000.04722.12
7.0.40.0000.04720.13
7.0.30.0000.03720.08
7.0.20.0030.04320.13
7.0.10.0070.03720.09
7.0.00.0030.04020.09
5.6.280.0000.07720.78
5.6.220.0100.03320.67
5.6.210.0000.04320.76
5.6.200.0000.06020.96
5.6.190.0070.03720.95
5.6.180.0000.08021.11
5.6.170.0030.03321.11
5.6.160.0000.04721.02
5.6.150.0030.04021.18
5.6.140.0000.04321.01
5.6.130.0070.04021.01
5.6.120.0000.07721.06
5.6.110.0070.03721.11
5.6.100.0070.04720.95
5.6.90.0070.06721.00
5.6.80.0030.04020.38
5.6.70.0000.04020.47
5.6.60.0000.04720.48
5.6.50.0000.04020.45
5.6.40.0030.03720.31
5.6.30.0000.04320.38
5.6.20.0000.04020.36
5.6.10.0000.04320.29
5.6.00.0000.04020.30
5.5.360.0030.04020.30
5.5.350.0000.04720.46
5.5.340.0100.03320.78
5.5.330.0000.04720.80
5.5.320.0000.04320.63
5.5.310.0000.08320.79
5.5.300.0070.06320.89
5.5.290.0000.04720.90
5.5.280.0030.04320.77
5.5.270.0070.03720.91
5.5.260.0030.08020.82
5.5.250.0130.07720.58
5.5.240.0000.04020.30
5.5.230.0030.04720.14
5.5.220.0070.03320.17
5.5.210.0070.03320.02
5.5.200.0000.04320.16
5.5.190.0000.04320.14
5.5.180.0000.04020.16
5.5.160.0030.03720.18
5.5.150.0000.04320.18
5.5.140.0000.03320.14
5.5.130.0070.06720.12
5.5.120.0070.08320.25
5.5.110.0070.08020.10
5.5.100.0070.07320.10
5.5.90.0030.07719.98
5.5.80.0000.05320.13
5.5.70.0070.07720.16
5.5.60.0030.08320.06
5.5.50.0030.04020.09
5.5.40.0000.07720.08
5.5.30.0030.07720.03
5.5.20.0070.07020.11
5.5.10.0000.08320.02
5.5.00.0070.06320.11
5.4.450.0030.03719.46
5.4.440.0000.05319.18
5.4.430.0000.04319.20
5.4.420.0000.06719.46
5.4.410.0000.04019.14
5.4.400.0000.04019.18
5.4.390.0000.04019.21
5.4.380.0000.03719.13
5.4.370.0000.04018.95
5.4.360.0070.03319.18
5.4.350.0000.03718.96
5.4.340.0030.03719.10
5.4.320.0000.03718.90
5.4.310.0070.03719.14
5.4.300.0000.07319.04
5.4.290.0070.06019.14
5.4.280.0030.04018.95
5.4.270.0100.07019.03
5.4.260.0030.08018.95
5.4.250.0000.06018.84
5.4.240.0000.07319.19
5.4.230.0030.07319.20
5.4.220.0000.08019.16
5.4.210.0070.07319.12
5.4.200.0000.06718.86
5.4.190.0070.06718.95
5.4.180.0030.04319.20
5.4.170.0030.07019.11
5.4.160.0030.07019.18
5.4.150.0030.08019.11
5.4.140.0030.07716.15
5.4.130.0000.07316.45
5.4.120.0000.04316.41
5.4.110.0030.07316.43
5.4.100.0000.05716.43
5.4.90.0030.03316.42
5.4.80.0000.04316.45
5.4.70.0000.08016.49
5.4.60.0030.05716.31
5.4.50.0000.08016.31
5.4.40.0030.07716.39
5.4.30.0030.07016.43
5.4.20.0000.04016.41
5.4.10.0000.07316.41
5.4.00.0030.07715.84
5.3.290.0030.03714.61
5.3.280.0030.07714.66
5.3.270.0030.07714.66
5.3.260.0000.08014.58
5.3.250.0070.07714.64
5.3.240.0030.06714.58
5.3.230.0000.04014.63
5.3.220.0100.05714.50
5.3.210.0000.04714.57
5.3.200.0000.04314.50
5.3.190.0000.03714.60
5.3.180.0000.04314.70
5.3.170.0070.08014.60
5.3.160.0070.03714.63
5.3.150.0000.03714.57
5.3.140.0030.07014.66
5.3.130.0070.05014.66
5.3.120.0030.04014.61
5.3.110.0000.05014.69
5.3.100.0030.08013.96
5.3.90.0100.07013.95
5.3.80.0000.05314.03
5.3.70.0030.06713.96
5.3.60.0030.05014.00
5.3.50.0030.05013.88
5.3.40.0030.06713.99
5.3.30.0030.03314.02
5.3.20.0030.03313.79
5.3.10.0000.03713.58
5.3.00.0030.05713.63
5.2.170.0030.06012.21
5.2.160.0030.03312.21
5.2.150.0000.03312.21
5.2.140.0070.02312.21
5.2.130.0000.03012.21
5.2.120.0030.06012.21
5.2.110.0000.03712.21
5.2.100.0030.04012.21
5.2.90.0000.03012.21
5.2.80.0030.02712.21
5.2.70.0030.04312.21
5.2.60.0000.03012.21
5.2.50.0000.03012.21
5.2.40.0000.03012.21
5.2.30.0030.02712.21
5.2.20.0000.03012.21
5.2.10.0030.05012.21
5.2.00.0030.02712.21
5.1.60.0000.03012.21
5.1.50.0030.05012.21
5.1.40.0030.03012.21
5.1.30.0030.02312.21
5.1.20.0000.05712.21
5.1.10.0030.05012.21
5.1.00.0000.04012.21
5.0.50.0070.02312.21
5.0.40.0000.04712.21
5.0.30.0030.05312.21
5.0.20.0070.04012.21
5.0.10.0030.04312.21
5.0.00.0000.05712.21
4.4.90.0000.01712.21
4.4.80.0000.01312.21
4.4.70.0030.02012.21
4.4.60.0030.03312.21
4.4.50.0070.03012.21
4.4.40.0000.05012.21
4.4.30.0030.01712.21
4.4.20.0070.02312.21
4.4.10.0000.03712.21
4.4.00.0000.04712.21
4.3.110.0000.03712.21
4.3.100.0030.03312.21
4.3.90.0030.02712.21
4.3.80.0030.04712.21
4.3.70.0030.03312.21
4.3.60.0000.03012.21
4.3.50.0000.03712.21
4.3.40.0030.05012.21
4.3.30.0030.02312.21
4.3.20.0030.03012.21
4.3.10.0030.03312.21
4.3.00.0000.03712.21

preferences:
39.36 ms | 401 KiB | 5 Q