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.01016.75
8.3.50.0120.00721.99
8.3.40.0110.00719.02
8.3.30.0130.00018.70
8.3.20.0080.00020.18
8.3.10.0040.00421.77
8.3.00.0000.01117.59
8.2.180.0070.00718.05
8.2.170.0120.00622.96
8.2.160.0060.00822.14
8.2.150.0070.00024.18
8.2.140.0070.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00417.75
8.2.110.0060.00319.27
8.2.100.0030.00718.03
8.2.90.0060.00319.05
8.2.80.0040.00417.97
8.2.70.0050.00317.50
8.2.60.0060.00317.63
8.2.50.0000.00817.55
8.2.40.0030.00319.52
8.2.30.0040.00420.59
8.2.20.0000.00717.88
8.2.10.0030.00318.14
8.2.00.0050.00318.08
8.1.280.0100.00325.92
8.1.270.0030.00323.87
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0080.00020.86
8.1.230.0030.00717.77
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00517.35
8.1.190.0080.00019.01
8.1.180.0040.00418.10
8.1.170.0000.00819.02
8.1.160.0030.00321.91
8.1.150.0000.00718.91
8.1.140.0070.00019.59
8.1.130.0030.00317.68
8.1.120.0000.00717.38
8.1.110.0030.00317.50
8.1.100.0030.00317.39
8.1.90.0070.00017.51
8.1.80.0000.00817.48
8.1.70.0030.00317.39
8.1.60.0000.00817.64
8.1.50.0070.00017.60
8.1.40.0040.00417.55
8.1.30.0040.00417.55
8.1.20.0030.00617.69
8.1.10.0040.00417.62
8.1.00.0040.00417.64
8.0.300.0050.00318.77
8.0.290.0000.00716.63
8.0.280.0030.00318.25
8.0.270.0060.00316.89
8.0.260.0030.00317.27
8.0.250.0020.00516.84
8.0.240.0030.00316.86
8.0.230.0000.00716.93
8.0.220.0070.00016.68
8.0.210.0000.00716.88
8.0.200.0070.00016.87
8.0.190.0030.00316.71
8.0.180.0050.00316.96
8.0.170.0000.00816.81
8.0.160.0000.00816.81
8.0.150.0000.00816.80
8.0.140.0000.00716.78
8.0.130.0090.00013.39
8.0.120.0040.00416.91
8.0.110.0000.00716.76
8.0.100.0070.00016.85
8.0.90.0070.00016.67
8.0.80.0060.01116.74
8.0.70.0000.00716.87
8.0.60.0000.00716.63
8.0.50.0030.00516.93
8.0.30.0190.00217.13
8.0.20.0060.01517.40
8.0.10.0040.00416.97
8.0.00.0120.00616.62
7.4.330.0020.00215.08
7.4.320.0060.00016.33
7.4.300.0030.00316.45
7.4.290.0030.00316.43
7.4.280.0040.00416.65
7.4.270.0000.00616.43
7.4.260.0040.00416.52
7.4.250.0070.00016.41
7.4.240.0040.00316.44
7.4.230.0060.00016.50
7.4.220.0090.01216.24
7.4.210.0080.00616.63
7.4.200.0000.00716.70
7.4.160.0120.00316.37
7.4.150.0070.01017.40
7.4.140.0180.00717.86
7.4.130.0030.01416.51
7.4.120.0070.01116.46
7.4.110.0190.00616.52
7.4.100.0140.00416.52
7.4.90.0140.00716.45
7.4.80.0150.00219.39
7.4.70.0090.00916.50
7.4.60.0120.00416.28
7.4.50.0000.00816.50
7.4.40.0110.00516.29
7.4.30.0040.01416.37
7.4.00.0100.00315.00
7.3.330.0030.00313.44
7.3.320.0000.00513.40
7.3.310.0000.00616.26
7.3.300.0040.00416.38
7.3.290.0000.00716.28
7.3.280.0060.01116.37
7.3.270.0120.00617.40
7.3.260.0080.00816.48
7.3.250.0070.01216.43
7.3.240.0060.01216.33
7.3.230.0150.00316.45
7.3.210.0080.00816.46
7.3.200.0090.00916.48
7.3.190.0000.01716.56
7.3.180.0060.01216.35
7.3.170.0060.01016.27
7.3.160.0080.00816.28
7.3.00.0000.01516.52
7.2.330.0100.00716.76
7.2.320.0110.00816.71
7.2.310.0090.00916.36
7.2.300.0080.01216.82
7.2.290.0070.01016.35
7.2.130.0040.01216.95
7.2.120.0030.01316.77
7.2.110.0030.00616.88
7.2.100.0060.00917.01
7.2.90.0070.00317.02
7.2.80.0040.00816.79
7.2.70.0060.00617.02
7.2.60.0070.00716.76
7.2.50.0160.00317.08
7.2.40.0000.01216.73
7.2.30.0060.00616.83
7.2.20.0030.01016.93
7.2.10.0060.00816.59
7.2.00.0000.01016.92
7.1.250.0300.00015.91
7.1.240.0070.01115.86
7.1.230.0080.00815.84
7.1.220.0070.00315.49
7.1.210.0000.01415.52
7.1.200.0100.00615.79
7.1.190.0040.01115.55
7.1.180.0120.00015.77
7.1.170.0090.00615.61
7.1.160.0110.00415.48
7.1.150.0000.01015.80
7.1.140.0090.00315.61
7.1.130.0040.00415.85
7.1.120.0140.00415.85
7.1.110.0080.00815.54
7.1.100.0030.00815.79
7.1.90.0000.01115.75
7.1.80.0000.00815.61
7.1.70.0090.00616.56
7.1.60.0060.00817.48
7.1.50.0100.00816.11
7.1.40.0070.00715.59
7.1.30.0060.00915.44
7.1.20.0040.00715.77
7.1.10.0040.00715.52
7.1.00.0050.03919.05
7.0.330.0060.00315.52
7.0.320.0070.00715.14
7.0.310.0040.00415.41
7.0.300.0030.00715.09
7.0.290.0040.00415.44
7.0.280.0000.00715.63
7.0.270.0110.00415.38
7.0.260.0030.01015.41
7.0.250.0030.00615.56
7.0.240.0060.00315.59
7.0.230.0090.00315.47
7.0.220.0000.00915.64
7.0.210.0030.01015.38
7.0.200.0070.00314.97
7.0.190.0030.00315.61
7.0.180.0140.00015.58
7.0.170.0060.00315.37
7.0.160.0100.00315.48
7.0.150.0000.00915.37
7.0.140.0030.00915.50
7.0.130.0040.00415.54
7.0.120.0100.00015.30
7.0.110.0040.01115.56
7.0.100.0060.00615.46
7.0.90.0040.00815.53
7.0.80.0070.00715.54
7.0.70.0000.00715.49
7.0.60.0140.03817.73
7.0.50.0020.03316.70
7.0.40.0070.02716.69
7.0.30.0120.02816.70
7.0.20.0210.03816.68
7.0.10.0030.04316.66
7.0.00.0060.03916.75
5.6.380.0030.01313.91
5.6.370.0120.00614.29
5.6.360.0120.00314.52
5.6.350.0050.00314.08
5.6.340.0070.00714.28
5.6.330.0000.01314.09
5.6.320.0170.00014.28
5.6.310.0100.00014.16
5.6.300.0060.00914.27
5.6.290.0040.00414.39
5.6.280.0070.01817.59
5.6.270.0070.00714.29
5.6.260.0070.00714.09
5.6.250.0100.00313.83
5.6.240.0100.00314.12
5.6.230.0110.00014.07
5.6.220.0030.01014.24
5.6.210.0050.03317.21
5.6.200.0090.03516.13
5.6.190.0060.02317.23
5.6.180.2050.02217.39
5.6.170.0240.04117.37
5.6.160.0060.02417.33
5.6.150.0050.02216.03
5.6.140.0090.02816.08
5.6.130.0050.04116.07
5.6.120.0030.03817.48
5.6.110.0130.03717.63
5.6.100.0100.03817.76
5.6.90.0100.02517.60
5.6.80.0030.04517.13
5.6.70.0060.00314.13
5.6.60.0140.00013.80
5.6.50.0030.01014.18
5.6.40.0090.00614.21
5.6.30.0000.01313.80
5.6.20.0060.00614.16
5.6.10.0070.00713.91
5.6.00.0030.00914.09
5.5.380.0060.00310.77
5.5.370.0030.00911.17
5.5.360.0030.00310.88
5.5.350.0130.03315.68
5.5.340.0030.02514.30
5.5.330.0070.02815.59
5.5.320.0130.02315.70
5.5.310.0120.02515.69
5.5.300.0070.03214.43
5.5.290.0020.04514.42
5.5.280.0090.04115.89
5.5.270.0080.04315.77
5.5.260.0070.04816.00
5.5.250.0050.04215.82
5.5.240.0080.01715.50
5.5.230.0060.00610.79
5.5.220.0040.00410.68
5.5.210.0040.00810.94
5.5.200.0030.00311.02
5.5.190.0040.00411.05
5.5.180.0000.00910.93
5.5.170.0000.01210.98
5.5.160.0000.00610.97
5.5.150.0110.00010.96
5.5.140.0030.00311.00
5.5.130.0030.00310.96
5.5.120.0090.00311.08
5.5.110.0030.00510.82
5.5.100.0030.00510.81
5.5.90.0030.00610.88
5.5.80.0040.00710.57
5.5.70.0030.00510.74
5.5.60.0060.00610.94
5.5.50.0030.00511.01
5.5.40.0110.00010.95
5.5.30.0050.00211.05
5.5.20.0050.00310.93
5.5.10.0040.00811.02
5.5.00.0030.00510.95
5.4.450.0130.03415.31
5.4.440.0130.03115.24
5.4.430.0070.04114.96
5.4.420.0060.04115.15
5.4.410.0140.03915.18
5.4.400.0100.03715.03
5.4.390.0200.03915.01
5.4.380.0270.03414.78
5.4.370.0250.03215.01
5.4.360.0330.03614.85
5.4.350.0130.03615.04
5.4.340.0080.04214.97
5.4.330.0060.00010.80
5.4.320.0300.03214.88
5.4.310.0280.02814.99
5.4.300.0150.03414.97
5.4.290.0280.03514.97
5.4.280.0270.03814.97
5.4.270.0230.03614.96
5.4.260.0070.03115.14
5.4.250.0260.03214.92
5.4.240.0120.04214.83
5.4.230.0180.03114.76
5.4.220.0080.03114.89
5.4.210.0100.03314.90
5.4.200.0080.03714.88
5.4.190.0270.02814.78
5.4.180.0170.03414.90
5.4.170.0150.03315.01
5.4.160.0150.03714.83
5.4.150.0130.03814.89
5.4.140.0170.03613.72
5.4.130.0320.03513.56
5.4.120.0280.03113.80
5.4.110.0320.03013.73
5.4.100.0080.03013.75
5.4.90.0180.02213.62
5.4.80.0100.03513.60
5.4.70.0190.02413.71
5.4.60.0080.03513.65
5.4.50.0100.03513.70
5.4.40.0070.03213.53
5.4.30.0120.03013.57
5.4.20.0120.03213.47
5.4.10.0130.02813.72
5.4.00.0080.04313.40

preferences:
60.37 ms | 401 KiB | 5 Q