3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen() { echo "1\n"; $ret = (yield 'yield1'); echo "2\n"; var_dump($ret); echo "3\n"; $ret = (yield 'yield2'); echo "4\n"; var_dump($ret); } $gen = gen(); var_dump($gen->current()); // string(6) "yield1" var_dump($gen->send('ret1')); // string(4) "ret1" (the first var_dump in gen) // string(6) "yield2" (the var_dump of the ->send() return value) var_dump($gen->send('ret2')); // string(4) "ret2" (again from within gen) // NULL (the return value of ->send())

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.0000.01518.31
8.3.50.0120.00321.27
8.3.40.0070.00718.67
8.3.30.0130.00319.04
8.3.20.0000.00720.35
8.3.10.0040.00421.95
8.3.00.0040.00422.35
8.2.180.0040.01116.38
8.2.170.0000.01522.96
8.2.160.0130.00020.47
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0130.00026.16
8.2.120.0090.00019.53
8.2.110.0000.01021.13
8.2.100.0080.00417.61
8.2.90.0000.00819.09
8.2.80.0030.00717.97
8.2.70.0000.00917.50
8.2.60.0060.00317.80
8.2.50.0030.00618.07
8.2.40.0030.00518.09
8.2.30.0080.00017.96
8.2.20.0020.00517.59
8.2.10.0040.00417.68
8.2.00.0030.00617.69
8.1.280.0140.00325.92
8.1.270.0040.01120.36
8.1.260.0060.00326.35
8.1.250.0080.00028.09
8.1.240.0060.00321.24
8.1.230.0100.00317.51
8.1.220.0050.00317.74
8.1.210.0080.00018.77
8.1.200.0090.00017.35
8.1.190.0040.00417.22
8.1.180.0040.00420.11
8.1.170.0040.00418.61
8.1.160.0040.00422.05
8.1.150.0050.00218.59
8.1.140.0000.01017.48
8.1.130.0070.00017.89
8.1.120.0000.00717.46
8.1.110.0000.00817.39
8.1.100.0000.00717.47
8.1.90.0000.00717.39
8.1.80.0000.00717.50
8.1.70.0070.00017.48
8.1.60.0000.00817.49
8.1.50.0050.00217.51
8.1.40.0030.00617.52
8.1.30.0050.00317.63
8.1.20.0000.00717.54
8.1.10.0070.00017.59
8.1.00.0000.00817.49
8.0.300.0080.00018.77
8.0.290.0030.00516.63
8.0.280.0000.00718.36
8.0.270.0030.00317.14
8.0.260.0070.00016.86
8.0.250.0070.00016.92
8.0.240.0000.00816.97
8.0.230.0000.00716.91
8.0.220.0050.00216.79
8.0.210.0030.00316.89
8.0.200.0050.00317.00
8.0.190.0000.00716.92
8.0.180.0040.00416.91
8.0.170.0040.00416.80
8.0.160.0070.00016.95
8.0.150.0030.00316.93
8.0.140.0070.00016.86
8.0.130.0060.00013.29
8.0.120.0050.00316.86
8.0.110.0050.00316.80
8.0.100.0000.00816.96
8.0.90.0000.00716.84
8.0.80.0070.00716.93
8.0.70.0000.00716.89
8.0.60.0040.00316.92
8.0.50.0040.00416.84
8.0.30.0120.00817.13
8.0.20.0010.01617.41
8.0.10.0050.00316.89
8.0.00.0120.00716.88
7.4.330.0050.00015.13
7.4.320.0030.00316.57
7.4.300.0030.00316.59
7.4.290.0040.00416.52
7.4.280.0030.00316.48
7.4.270.0040.00416.51
7.4.260.0000.00716.45
7.4.250.0050.00316.55
7.4.240.0050.00316.55
7.4.230.0000.00716.70
7.4.220.0070.01316.44
7.4.210.0110.00616.58
7.4.200.0040.00416.61
7.4.190.0030.00516.67
7.4.160.0090.00916.52
7.4.150.0170.00317.40
7.4.140.0110.00917.86
7.4.130.0110.00916.61
7.4.120.0120.00816.44
7.4.110.0140.00416.33
7.4.100.0040.01316.57
7.4.90.0070.01416.55
7.4.80.0130.01319.39
7.4.70.0060.01016.47
7.4.60.0120.00616.64
7.4.50.0000.00516.54
7.4.40.0090.00622.77
7.4.30.0070.01016.44
7.4.00.0090.00915.02
7.3.330.0000.00513.21
7.3.320.0060.00013.07
7.3.310.0000.00716.35
7.3.300.0030.00316.09
7.3.290.0040.01116.21
7.3.280.0050.01116.25
7.3.270.0190.00017.40
7.3.260.0200.00316.29
7.3.250.0100.00716.47
7.3.240.0030.01716.35
7.3.230.0100.01316.39
7.3.210.0120.00616.47
7.3.200.0060.01219.39
7.3.190.0140.00316.28
7.3.180.0110.00816.25
7.3.170.0130.00316.57
7.3.160.0160.00016.64
7.3.120.0130.00514.76
7.3.110.0140.00414.52
7.3.100.0080.00815.01
7.3.90.0000.01614.59
7.3.80.0000.01314.77
7.3.70.0090.00614.79
7.3.60.0040.01214.80
7.3.50.0120.00414.70
7.3.40.0040.01114.77
7.3.30.0030.01214.52
7.3.20.0110.00316.61
7.3.10.0030.01516.59
7.3.00.0140.00316.67
7.2.330.0110.00716.73
7.2.320.0080.00816.40
7.2.310.0100.01316.68
7.2.300.0040.01316.78
7.2.290.0040.01216.75
7.2.250.0100.01015.24
7.2.240.0070.01314.89
7.2.230.0140.00414.75
7.2.220.0050.00614.81
7.2.210.0070.00714.84
7.2.200.0080.00314.82
7.2.190.0090.00615.02
7.2.180.0000.01315.03
7.2.170.0060.00314.80
7.2.00.0000.01119.38
7.1.330.0070.00715.58
7.1.320.0030.00715.77
7.1.310.0040.01115.98
7.1.300.0030.00715.52
7.1.290.0060.00915.81
7.1.280.0030.01015.75
7.1.270.0100.00715.79
7.1.260.0100.00315.81
7.1.100.0040.01117.88
7.1.70.0030.00617.02
7.1.60.0180.00719.82
7.1.50.0070.01616.63
7.1.00.0030.05722.35
7.0.200.0000.01016.69
7.0.140.0070.08722.09
7.0.60.0070.03719.91
7.0.50.0030.04317.88
7.0.40.0030.04719.96
7.0.30.0270.08020.32
7.0.20.0330.07720.06
7.0.10.0030.08320.15
7.0.00.0130.07720.06
5.6.280.0030.07320.91
5.6.210.0100.07720.47
5.6.200.0070.08018.22
5.6.190.0000.04720.34
5.6.180.0300.07020.61
5.6.170.0330.04720.55
5.6.160.0070.05020.44
5.6.150.0100.05318.15
5.6.140.0030.04018.24
5.6.130.0030.06318.21
5.6.120.0070.08321.14
5.6.110.0130.07321.01
5.6.100.0070.04021.00
5.6.90.0170.07720.95
5.6.80.0130.06720.51
5.6.70.4230.04020.40
5.5.350.0100.08720.41
5.5.340.0070.07318.03
5.5.330.0070.08320.47
5.5.320.0030.08020.51
5.5.310.0300.08320.25
5.5.300.0070.03717.98
5.5.290.0100.07018.00
5.5.280.0000.04320.98
5.5.270.0070.04020.67
5.5.260.0030.04320.64
5.5.250.0070.05020.46
5.5.240.0230.08020.26
5.4.450.0570.04319.55
5.4.440.0300.04019.41
5.4.430.0300.03719.52
5.4.420.0130.05019.63
5.4.410.0270.06018.72
5.4.400.0370.08018.76
5.4.390.0200.05318.80
5.4.380.0230.05718.78
5.4.370.0030.06018.61
5.4.360.0200.04718.71
5.4.350.0090.03812.03
5.4.340.0090.04912.03
5.4.320.0070.03512.52
5.4.310.0050.03812.51
5.4.300.0070.05012.52
5.4.290.0080.04312.51
5.4.280.0080.04212.41
5.4.270.0070.03912.41
5.4.260.0050.03712.41
5.4.250.0070.05318.69
5.4.240.0030.05718.74
5.4.230.0200.06018.71
5.4.220.0100.06318.73
5.4.210.0130.07018.92
5.4.200.0130.06318.95
5.4.190.0100.05018.89
5.4.180.0100.04718.93
5.4.170.0100.05719.03
5.4.160.0070.06718.73
5.4.150.0100.07718.94
5.4.140.0030.05716.41
5.4.130.0170.04716.43
5.4.120.0030.06016.47
5.4.110.0070.05316.41
5.4.100.0130.05716.42
5.4.90.0170.05716.45
5.4.80.0130.04316.40
5.4.70.0170.05016.37
5.4.60.0170.05016.41
5.4.50.0100.04716.42
5.4.40.0130.05016.50
5.4.30.0170.04316.46
5.4.20.0070.05716.41
5.4.10.0100.05016.54
5.4.00.0100.04715.83
5.3.290.0070.04812.80
5.3.280.0130.06714.81
5.3.270.0100.05014.74
5.3.260.0170.04714.59
5.3.250.0170.04014.57
5.3.240.0030.05714.67
5.3.230.0130.05014.70
5.3.220.0070.05014.70
5.3.210.0130.04714.65
5.3.200.0070.06714.40
5.3.190.0130.04714.55
5.3.180.0030.05314.39
5.3.170.0100.04714.65
5.3.160.0070.05314.70
5.3.150.0100.04714.72
5.3.140.0130.06714.55
5.3.130.0130.05014.51
5.3.120.0000.06714.54
5.3.110.0100.05014.55
5.3.100.0170.05014.12
5.3.90.0170.06013.85
5.3.80.0130.05714.18
5.3.70.0030.05314.08
5.3.60.0130.04314.17
5.3.50.0100.04714.03
5.3.40.0100.05314.03
5.3.30.0100.06014.13
5.3.20.0170.03713.77
5.3.10.0170.05313.88
5.3.00.0130.06013.71
5.2.170.0070.04011.36
5.2.160.0130.03311.30
5.2.150.0100.03711.22
5.2.140.0030.04311.12
5.2.130.0130.04711.05
5.2.120.0070.05311.07
5.2.110.0030.05711.07
5.2.100.0030.04311.18
5.2.90.0100.05311.01
5.2.80.0000.04710.93
5.2.70.0170.03010.99
5.2.60.0070.04011.12
5.2.50.0030.06011.09
5.2.40.0200.03011.07
5.2.30.0070.04311.04
5.2.20.0070.03710.96
5.2.10.0000.04311.02
5.2.00.0030.04010.77
5.1.60.0130.02310.03
5.1.50.0100.02710.06
5.1.40.0070.0339.93
5.1.30.0030.03710.43
5.1.20.0030.03710.35
5.1.10.0130.03010.30
5.1.00.0070.04310.10
5.0.50.0030.0308.38
5.0.40.0030.0308.38
5.0.30.0100.0378.27
5.0.20.0070.0338.29
5.0.10.0070.0278.11
5.0.00.0030.0408.14
4.4.90.0070.0175.80
4.4.80.0030.0235.83
4.4.70.0000.0235.84
4.4.60.0000.0275.81
4.4.50.0030.0235.86
4.4.40.0030.0335.80
4.4.30.0070.0235.86
4.4.20.0070.0175.95
4.4.10.0000.0305.90
4.4.00.0100.0275.89
4.3.110.0000.0235.80
4.3.100.0000.0335.84
4.3.90.0000.0335.80
4.3.80.0000.0436.13
4.3.70.0100.0236.13
4.3.60.0000.0336.13
4.3.50.0100.0206.13
4.3.40.0070.0406.13
4.3.30.0030.0206.13
4.3.20.0000.0236.13
4.3.10.0030.0206.13
4.3.00.0130.01314.52

preferences:
36.24 ms | 401 KiB | 5 Q