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 make($id, $self) { return new X($id, $self); } function gen() { $self = (yield 0); echo "After yield 0\n"; $k = make('key', $self); $v = make('value', $self); yield $k => $v; unset($k, $v); 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.0100.00716.62
8.3.50.0110.00622.05
8.3.40.0040.01118.66
8.3.30.0100.00318.88
8.3.20.0000.00820.16
8.3.10.0000.00721.89
8.3.00.0090.00017.50
8.2.180.0070.01418.29
8.2.170.0100.00722.96
8.2.160.0130.00019.47
8.2.150.0040.00424.18
8.2.140.0000.00724.66
8.2.130.0030.00326.16
8.2.120.0070.00017.63
8.2.110.0100.00022.25
8.2.100.0110.00017.93
8.2.90.0070.00019.05
8.2.80.0070.00017.97
8.2.70.0090.00017.50
8.2.60.0070.00017.93
8.2.50.0080.00018.07
8.2.40.0070.00019.39
8.2.30.0070.00020.75
8.2.20.0040.00417.68
8.2.10.0000.00718.14
8.2.00.0000.00818.04
8.1.280.0070.00725.92
8.1.270.0050.00323.83
8.1.260.0080.00026.35
8.1.250.0030.00328.09
8.1.240.0040.00422.70
8.1.230.0080.00317.79
8.1.220.0070.00017.74
8.1.210.0060.00318.77
8.1.200.0050.00517.35
8.1.190.0040.00417.23
8.1.180.0000.00718.10
8.1.170.0000.00818.88
8.1.160.0020.00422.03
8.1.150.0070.00018.88
8.1.140.0050.00517.43
8.1.130.0070.00017.82
8.1.120.0030.00317.53
8.1.110.0030.00317.34
8.1.100.0000.00717.46
8.1.90.0030.00317.49
8.1.80.0080.00017.47
8.1.70.0030.00317.45
8.1.60.0000.00717.63
8.1.50.0000.00817.61
8.1.40.0030.00517.59
8.1.30.0040.00417.68
8.1.20.0050.00317.66
8.1.10.0050.00217.66
8.1.00.0040.00417.65
8.0.300.0040.00418.77
8.0.290.0030.00316.63
8.0.280.0060.00018.44
8.0.270.0000.00716.76
8.0.260.0030.00317.23
8.0.250.0000.00716.93
8.0.240.0040.00416.92
8.0.230.0030.00316.95
8.0.220.0030.00516.78
8.0.210.0000.00716.82
8.0.200.0000.00716.84
8.0.190.0000.00716.90
8.0.180.0000.00816.82
8.0.170.0050.00316.89
8.0.160.0000.00716.95
8.0.150.0040.00416.91
8.0.140.0040.00416.74
8.0.130.0030.00313.33
8.0.120.0040.00416.80
8.0.110.0000.00716.78
8.0.100.0040.00416.96
8.0.90.0000.00716.89
8.0.80.0100.00516.86
8.0.70.0040.00416.80
8.0.60.0030.00316.63
8.0.50.0070.00416.79
8.0.30.0070.01117.01
8.0.20.0070.01117.40
8.0.10.0040.00417.08
8.0.00.0090.00916.83
7.4.330.0030.00315.08
7.4.320.0060.00016.36
7.4.300.0030.00316.56
7.4.290.0030.00316.47
7.4.280.0030.00316.53
7.4.270.0030.00316.46
7.4.260.0030.00316.38
7.4.250.0000.00716.28
7.4.240.0020.00516.54
7.4.230.0030.00316.54
7.4.220.0100.01116.39
7.4.210.0090.00816.47
7.4.200.0040.00416.55
7.4.160.0060.00916.39
7.4.150.0080.01117.40
7.4.140.0110.01417.86
7.4.130.0200.00016.35
7.4.120.0120.00816.53
7.4.110.0100.01316.43
7.4.100.0160.00716.39
7.4.90.0140.00416.72
7.4.80.0150.00319.39
7.4.70.0030.01316.52
7.4.60.0130.00316.37
7.4.50.0000.00816.30
7.4.40.0030.01316.68
7.4.30.0130.01016.50
7.4.00.0010.01314.97
7.3.330.0020.00213.23
7.3.320.0020.00213.23
7.3.310.0070.00016.20
7.3.300.0080.00016.38
7.3.290.0030.00316.41
7.3.280.0090.00816.34
7.3.270.0090.01317.40
7.3.260.0170.00016.63
7.3.240.0160.00616.53
7.3.230.0070.01016.39
7.3.210.0090.00916.16
7.3.200.0030.01316.38
7.3.190.0130.00316.56
7.3.180.0160.00716.54
7.3.170.0110.00416.43
7.3.160.0100.00716.52
7.3.120.0130.00614.92
7.3.110.0040.01514.84
7.3.100.0090.00614.90
7.3.90.0130.00314.89
7.3.80.0000.01115.16
7.3.70.0030.00614.58
7.3.60.0070.00414.98
7.3.50.0070.00715.01
7.3.40.0110.00414.66
7.3.30.0060.00314.95
7.3.20.0090.00016.34
7.3.10.0030.00716.78
7.3.00.0070.00316.59
7.2.330.0140.00516.68
7.2.320.0110.00716.57
7.2.310.0100.01316.77
7.2.300.0120.00616.79
7.2.290.0100.00716.52
7.2.250.0000.01915.09
7.2.240.0100.01015.25
7.2.230.0070.00315.38
7.2.220.0080.00815.13
7.2.210.0080.00414.73
7.2.200.0100.00314.79
7.2.190.0060.00615.05
7.2.180.0070.00714.87
7.2.170.0080.00315.02
7.2.60.0040.01116.95
7.2.00.0000.00919.39
7.1.330.0000.01515.84
7.1.320.0000.01415.84
7.1.310.0060.00315.83
7.1.300.0030.00715.66
7.1.290.0030.00615.84
7.1.280.0060.00315.82
7.1.270.0000.01015.58
7.1.260.0030.01015.77
7.1.200.0090.00315.86
7.1.100.0060.00618.25
7.1.70.0000.00817.27
7.1.60.0070.01119.43
7.1.50.0060.00617.02
7.1.00.0070.07022.44
7.0.200.0260.00714.67
7.0.60.0100.07719.93
7.0.50.0030.08017.92
7.0.40.0100.07719.89
7.0.30.0230.08319.91
7.0.20.0300.08019.95
7.0.10.0100.04019.97
7.0.00.0100.08019.82
5.6.280.0000.03321.05
5.6.210.0070.08020.74
5.6.200.0170.03318.20
5.6.190.0100.08320.48
5.6.180.3470.04020.78
5.6.170.0370.06320.57
5.6.160.0070.06020.40
5.6.150.0030.04018.29
5.6.140.0070.08318.20
5.6.130.0030.04018.13
5.6.120.0100.04321.00
5.6.110.0100.05721.00
5.6.100.0070.08321.00
5.6.90.0070.06720.98
5.6.80.0130.07020.45
5.5.350.0270.08020.31
5.5.340.0230.05718.08
5.5.330.0130.04720.30
5.5.320.0300.04320.19
5.5.310.0330.07320.34
5.5.300.0030.08017.95
5.5.290.0000.06318.00
5.5.280.0070.05320.96
5.5.270.0130.03320.88
5.5.260.0130.06720.89
5.5.250.0030.08320.66
5.5.240.0130.07320.38
5.4.450.0270.05019.32
5.4.440.0230.04719.47
5.4.430.0270.03719.63
5.4.420.0230.04319.54
5.4.410.0330.06719.32
5.4.400.0270.06719.20
5.4.390.0300.07319.09
5.4.380.0330.03319.21
5.4.370.0230.07719.05
5.4.360.0230.04019.16
5.4.350.0170.04719.31
5.4.340.0270.04319.24
5.4.320.0200.05718.85
5.4.310.0270.03319.07
5.4.300.0170.04318.94
5.4.290.0300.07018.88
5.4.280.0270.07719.07
5.4.270.0400.05719.09
5.4.260.0270.05718.97
5.4.250.0270.04719.21
5.4.240.0370.03319.15
5.4.230.0200.04319.07
5.4.220.0230.05319.13
5.4.210.0230.04019.08
5.4.200.0300.07019.08
5.4.190.0300.05719.07
5.4.180.0330.06719.18
5.4.170.0330.05318.98
5.4.160.0200.04318.96
5.4.150.0370.05718.85
5.4.140.0270.04316.40
5.4.130.0300.06316.42
5.4.120.0370.06016.37
5.4.110.0370.04016.59
5.4.100.0330.06316.61
5.4.90.0400.05716.56

preferences:
37.88 ms | 401 KiB | 5 Q