3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X { function __construct($id, $gen) { $this->id = $id; $this->gen = $gen; } function __destruct() { echo "__destruct $this->id\n"; var_dump($this->gen->current()); var_dump($this->gen->key()); echo "\n\n"; } } function gen() { $self = yield (0); echo "After yield 0\n"; yield new X('key', $self) => new X('value', $self); echo "After yield X\n"; yield 12; } $a = gen(); var_dump($a->current()); $a->send($a); var_dump($a->current()); $a->next();

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.0070.01016.63
8.3.50.0120.00821.99
8.3.40.0110.00418.79
8.3.30.0110.00418.71
8.3.20.0030.00320.35
8.3.10.0040.00423.59
8.3.00.0060.00317.35
8.2.180.0130.00617.93
8.2.170.0130.00322.96
8.2.160.0100.00719.28
8.2.150.0070.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0050.00317.50
8.2.110.0060.00622.20
8.2.100.0040.00717.93
8.2.90.0080.00019.09
8.2.80.0040.00417.97
8.2.70.0040.00717.63
8.2.60.0070.00018.04
8.2.50.0050.00218.07
8.2.40.0040.00421.15
8.2.30.0000.00720.76
8.2.20.0030.00517.69
8.2.10.0000.00718.07
8.2.00.0030.00618.15
8.1.280.0090.00925.92
8.1.270.0040.00423.92
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0080.00022.56
8.1.230.0110.00017.77
8.1.220.0030.00317.74
8.1.210.0000.00718.77
8.1.200.0030.00717.23
8.1.190.0000.00717.35
8.1.180.0000.00718.10
8.1.170.0000.00718.96
8.1.160.0000.00722.07
8.1.150.0000.00718.96
8.1.140.0000.00719.65
8.1.130.0030.00317.70
8.1.120.0000.00717.45
8.1.110.0000.00717.37
8.1.100.0030.00317.48
8.1.90.0030.00317.35
8.1.80.0050.00317.50
8.1.70.0050.00317.39
8.1.60.0000.00717.55
8.1.50.0000.00817.67
8.1.40.0040.00417.58
8.1.30.0040.00417.68
8.1.20.0070.00017.61
8.1.10.0030.00317.49
8.1.00.0000.00817.57
8.0.300.0050.00318.77
8.0.290.0040.00416.63
8.0.280.0000.00718.45
8.0.270.0040.00417.20
8.0.260.0060.00017.25
8.0.250.0040.00416.95
8.0.240.0000.00716.80
8.0.230.0070.00016.76
8.0.220.0030.00316.75
8.0.210.0050.00316.85
8.0.200.0060.00016.80
8.0.190.0030.00316.85
8.0.180.0000.00716.84
8.0.170.0040.00416.86
8.0.160.0030.00316.92
8.0.150.0070.00016.85
8.0.140.0070.00016.79
8.0.130.0030.00313.36
8.0.120.0000.00816.76
8.0.110.0000.00716.68
8.0.100.0040.00416.79
8.0.90.0030.00517.00
8.0.80.0060.01316.84
8.0.70.0030.00316.81
8.0.60.0000.00716.93
8.0.50.0030.00516.77
8.0.30.0090.00917.22
8.0.20.0100.00817.40
8.0.10.0040.00416.92
8.0.00.0140.00416.62
7.4.330.0050.00015.08
7.4.320.0000.00616.35
7.4.300.0000.00616.50
7.4.290.0000.00616.29
7.4.280.0050.00316.34
7.4.270.0030.00316.52
7.4.260.0000.00716.47
7.4.250.0040.00316.43
7.4.240.0000.00716.56
7.4.230.0070.00016.37
7.4.220.0100.01316.68
7.4.210.0070.00916.48
7.4.200.0000.00716.60
7.4.160.0090.00616.45
7.4.150.0070.01117.40
7.4.140.0130.00917.86
7.4.130.0080.01116.41
7.4.120.0110.01016.50
7.4.110.0160.00516.49
7.4.100.0160.00616.40
7.4.90.0100.00616.27
7.4.80.0080.00819.39
7.4.70.0090.00616.46
7.4.60.0000.01516.49
7.4.50.0040.00416.36
7.4.40.0000.01816.45
7.4.30.0070.01116.42
7.4.00.0110.00415.07
7.3.330.0050.00013.27
7.3.320.0020.00213.34
7.3.310.0030.00316.13
7.3.300.0000.00616.17
7.3.290.0000.00716.18
7.3.280.0100.00516.26
7.3.270.0100.00717.40
7.3.260.0130.00316.25
7.3.250.0100.00916.39
7.3.240.0120.00916.17
7.3.230.0120.00416.39
7.3.210.0110.00716.19
7.3.200.0090.00816.43
7.3.190.0100.00616.22
7.3.180.0120.00916.25
7.3.170.0120.00316.43
7.3.160.0060.00916.45
7.3.10.0110.00316.58
7.3.00.0030.00916.83
7.2.330.0130.00716.64
7.2.320.0110.00716.52
7.2.310.0070.01416.70
7.2.300.0160.00816.43
7.2.290.0090.00816.63
7.2.130.0100.01016.98
7.2.120.0000.00917.08
7.2.110.0070.00716.75
7.2.100.0060.00316.92
7.2.90.0100.00316.97
7.2.80.0030.00917.13
7.2.70.0000.01117.02
7.2.60.0080.00816.98
7.2.50.0060.00616.79
7.2.40.0030.01216.86
7.2.30.0040.00816.80
7.2.20.0030.00916.91
7.2.10.0030.01016.95
7.2.00.0040.00818.06
7.1.250.0110.00415.62
7.1.200.0120.00315.91
7.1.100.0030.00918.04
7.1.70.0000.00717.14
7.1.60.0070.01719.43
7.1.50.0090.00316.80
7.1.00.0030.07722.43
7.0.200.0550.00714.50
7.0.60.0070.06019.93
7.0.50.0130.06017.84
7.0.40.0070.04319.73
7.0.30.0230.08719.98
7.0.20.0200.05019.70
7.0.10.0130.08319.93
7.0.00.0130.07319.98
5.6.280.0030.03321.13
5.6.210.0130.07720.48
5.6.200.0130.07718.16
5.6.190.0030.05320.57
5.6.180.3400.03720.50
5.6.170.0400.06320.55
5.6.160.0100.06320.50
5.6.150.0030.04318.29
5.6.140.0130.07718.17
5.6.130.0000.04318.11
5.6.120.0100.07321.00
5.6.110.0100.07720.99
5.6.100.0170.07321.12
5.6.90.0200.07321.14
5.6.80.0100.08020.29
5.5.350.0400.07020.47
5.5.340.0030.05018.05
5.5.330.0130.06320.31
5.5.320.0230.04020.35
5.5.310.0170.05020.37
5.5.300.0070.07017.98
5.5.290.0030.05717.99
5.5.280.0070.08320.91
5.5.270.0030.05320.96
5.5.260.0130.08020.73
5.5.250.0070.08020.78
5.5.240.0000.08020.27
5.4.450.0100.06319.38
5.4.440.0370.07019.56
5.4.430.0570.06719.16
5.4.420.0630.05719.55
5.4.410.0600.06719.04
5.4.400.0530.05719.01
5.4.390.0300.08019.24
5.4.380.0300.06318.88
5.4.370.0230.06319.36
5.4.360.0270.06319.16
5.4.350.0230.06719.13
5.4.340.0100.07719.05
5.4.320.0170.05719.29
5.4.310.0530.05318.85
5.4.300.0570.07718.96
5.4.290.0570.07319.11
5.4.280.0600.05019.22
5.4.270.0670.04719.29
5.4.260.0530.08019.00
5.4.250.0570.06718.96
5.4.240.0830.05319.10
5.4.230.0530.04719.24
5.4.220.0730.06019.28
5.4.210.0570.06319.13
5.4.200.0230.06719.29
5.4.190.0170.07018.82
5.4.180.0170.07019.09
5.4.170.0270.05719.13
5.4.160.0130.05318.84
5.4.150.0230.04719.11
5.4.140.0200.05016.46
5.4.130.0130.05716.45
5.4.120.0200.04716.48
5.4.110.0170.05316.57
5.4.100.0200.06316.24
5.4.90.0070.07716.63
5.4.80.0170.04716.64
5.4.70.0230.05016.64
5.4.60.0470.05016.23
5.4.50.0300.04016.58
5.4.40.0200.05016.50
5.4.30.0230.06716.59
5.4.20.0270.04316.59
5.4.10.0330.06716.53
5.4.00.0130.07315.90

preferences:
55.53 ms | 401 KiB | 5 Q