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(); var_dump($a->getReturn());

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.0160.00316.50
8.3.50.0120.00617.93
8.3.40.0100.00718.79
8.3.30.0100.00318.67
8.3.20.0000.00820.16
8.3.10.0040.00423.65
8.3.00.0090.00019.48
8.2.180.0130.00718.16
8.2.170.0130.00022.96
8.2.160.0100.00719.46
8.2.150.0030.00524.18
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0030.00717.63
8.2.110.0060.00320.54
8.2.100.0070.00317.84
8.2.90.0000.00719.07
8.2.80.0000.00717.97
8.2.70.0060.00317.63
8.2.60.0000.00717.93
8.2.50.0040.00418.07
8.2.40.0000.00721.13
8.2.30.0030.00320.60
8.2.20.0000.00717.78
8.2.10.0040.00418.14
8.2.00.0080.00018.17
8.1.280.0160.00325.92
8.1.270.0040.00423.97
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0030.00623.86
8.1.230.0080.00320.91
8.1.220.0000.00717.74
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0070.00017.10
8.1.180.0070.00018.10
8.1.170.0040.00418.83
8.1.160.0040.00421.91
8.1.150.0030.00318.82
8.1.140.0040.00419.48
8.1.130.0030.00317.66
8.1.120.0000.00717.37
8.1.110.0000.00717.45
8.1.100.0070.00017.42
8.1.90.0070.00017.46
8.1.80.0070.00017.47
8.1.70.0030.00317.38
8.1.60.0030.00317.63
8.1.50.0030.00317.63
8.1.40.0040.00417.50
8.1.30.0030.00617.75
8.1.20.0000.00817.67
8.1.10.0070.00017.68
8.1.00.0080.00017.56
8.0.300.0040.00418.77
8.0.290.0030.00516.63
8.0.280.0030.00318.45
8.0.270.0030.00617.15
8.0.260.0030.00317.15
8.0.250.0030.00316.95
8.0.240.0000.00716.93
8.0.230.0000.00616.74
8.0.220.0030.00316.84
8.0.210.0070.00017.04
8.0.200.0060.00016.90
8.0.190.0000.00716.92
8.0.180.0080.00017.00
8.0.170.0040.00416.95
8.0.160.0000.00716.84
8.0.150.0070.00016.85
8.0.140.0030.00316.82
8.0.130.0030.00313.42
8.0.120.0050.00316.98
8.0.110.0070.00016.77
8.0.100.0000.00716.79
8.0.90.0040.00416.96
8.0.80.0070.01316.93
8.0.70.0000.00816.62
8.0.60.0070.00016.66
8.0.50.0040.00416.87
8.0.30.0140.00417.04
8.0.20.0140.00617.41
8.0.10.0000.00716.90
8.0.00.0100.01116.66
7.4.330.0060.00015.08
7.4.320.0000.00616.40
7.4.300.0000.00616.49
7.4.290.0030.00616.49
7.4.280.0000.00716.32
7.4.270.0070.00016.52
7.4.260.0050.00316.44
7.4.250.0040.00416.54
7.4.240.0060.00216.53
7.4.230.0030.00316.64
7.4.220.0090.01616.65
7.4.210.0040.01116.52
7.4.200.0000.00716.33
7.4.160.0100.00316.66
7.4.150.0120.01217.40
7.4.140.0140.00817.86
7.4.130.0160.00516.44
7.4.120.0140.00616.54
7.4.110.0170.02016.48
7.4.100.0130.01016.36
7.4.90.0040.01416.61
7.4.80.0100.00619.39
7.4.70.0130.00616.36
7.4.60.0080.00816.68
7.4.50.0040.00416.43
7.4.40.0050.01116.41
7.4.30.0110.01016.48
7.4.00.0100.00614.89
7.3.330.0000.00513.27
7.3.320.0000.00513.36
7.3.310.0070.00016.29
7.3.300.0060.00016.16
7.3.290.0030.00316.40
7.3.280.0110.00616.34
7.3.270.0030.01617.40
7.3.260.0130.00316.44
7.3.250.0110.00816.34
7.3.240.0120.00916.43
7.3.230.0080.00916.39
7.3.210.0030.01316.44
7.3.200.0050.01616.48
7.3.190.0040.01416.30
7.3.180.0040.01316.51
7.3.170.0070.01416.29
7.3.160.0120.00316.25
7.2.330.0160.00716.85
7.2.320.0140.00416.71
7.2.310.0100.01316.70
7.2.300.0130.01016.75
7.2.290.0060.01616.79
7.2.60.0070.00717.03
7.2.00.0060.00619.23
7.1.200.0030.00715.66
7.1.100.0040.01118.17
7.1.70.0000.01217.26
7.1.60.0070.01719.43
7.1.50.0000.01516.66
7.1.00.0130.06322.40
7.0.200.0610.00614.21
7.0.60.0070.07720.03
7.0.50.0070.06717.87
7.0.40.0070.04319.86
7.0.30.0200.03719.70
7.0.20.0230.04019.94
7.0.10.0100.07319.83
7.0.00.0000.05319.94
5.6.210.0100.08020.48
5.6.200.0070.07718.15
5.6.190.0030.09020.47
5.6.180.3600.04720.48
5.6.170.0200.04720.52
5.6.160.0030.05720.48
5.6.150.0100.03718.23
5.6.140.0070.08018.27
5.6.130.0070.04018.21
5.6.120.0030.04721.01
5.6.110.0070.08020.97
5.6.100.0170.05020.99
5.6.90.0100.05021.14
5.6.80.0170.06320.41
5.5.350.0400.06720.43
5.5.340.0130.04317.98
5.5.330.0070.08320.23
5.5.320.0300.07020.40
5.5.310.0370.05720.19
5.5.300.0030.08018.08
5.5.290.0030.05718.08
5.5.280.0170.07320.74
5.5.270.0000.04720.98
5.5.260.0130.06320.88
5.5.250.0070.07720.62
5.5.240.0130.07320.36
5.4.450.0670.06719.04
5.4.440.0630.07319.05
5.4.430.0630.06319.53
5.4.420.0270.07719.62
5.4.410.0270.06718.92
5.4.400.0170.05718.98
5.4.390.0200.06018.96
5.4.380.0270.05018.87
5.4.370.0130.05019.15
5.4.360.0470.05719.21
5.4.350.0570.05719.21
5.4.340.0630.05318.93
5.4.320.0730.05719.04
5.4.310.0730.04719.18
5.4.300.0070.06019.03
5.4.290.0430.07319.09
5.4.280.0630.06718.98
5.4.270.0970.04719.13
5.4.260.0800.07318.98
5.4.250.0730.06018.75
5.4.240.0600.04718.75
5.4.230.0730.05319.01
5.4.220.0630.05718.96
5.4.210.0170.05319.02
5.4.200.0130.05718.98
5.4.190.0130.07019.12
5.4.180.0500.06719.28
5.4.170.0500.07319.08
5.4.160.0500.07019.16
5.4.150.0130.06018.96
5.4.140.0270.06016.46
5.4.130.0130.07316.60
5.4.120.0130.07016.38
5.4.110.0330.04316.70
5.4.100.0170.04716.49
5.4.90.0070.05716.50
5.4.80.0170.05316.60
5.4.70.0230.06316.54
5.4.60.0200.06716.55
5.4.50.0530.06316.59
5.4.40.0270.06716.55
5.4.30.0770.06016.55
5.4.20.0400.05316.39
5.4.10.0170.06016.49
5.4.00.0130.05316.02

preferences:
61.72 ms | 401 KiB | 5 Q