3v4l.org

run code in 300+ PHP versions simultaneously
<?php gc_collect_cycles(); class myclass { public function __construct () { echo("constructor\n"); } public function __destruct () { echo("destructor\n"); } } $t = new temp(); $t->dupa = 'ddd'; $t->test = new myclass(); $temp = array( 0 => $t ); echo("------------1-----------\n"); foreach ($temp as $key => $ttt) { //unset($temp[$key]['test']); // $temp[$key]->test = null; // $temp[$key] = null; unset($temp[$key]->test, $temp[$key], $temp); } echo("------------2-----------\n"); echo("------------3-----------\n"); // gc_collect_cycles(); // foreach (range(1, 100000) as $a) // { // echo PHP_EOL.$a.PHP_EOL; // } class temp { public $dupa; public $test; public function __destruct () { echo PHP_EOL.'TEMP D.'.PHP_EOL; unset($this->test); } }

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.01118.33
8.3.50.0140.00822.00
8.3.40.0120.00318.79
8.3.30.0040.01119.14
8.3.20.0070.00020.14
8.3.10.0050.00321.82
8.3.00.0050.00319.13
8.2.180.0170.00318.14
8.2.170.0060.00922.96
8.2.160.0070.00722.26
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0070.01026.16
8.2.120.0040.00419.76
8.2.110.0100.00020.90
8.2.100.0070.00418.03
8.2.90.0030.00517.97
8.2.80.0060.00317.97
8.2.70.0040.00417.50
8.2.60.0000.00818.05
8.2.50.0040.00418.07
8.2.40.0000.00718.21
8.2.30.0040.00419.50
8.2.20.0040.00417.74
8.2.10.0060.00318.11
8.2.00.0040.00417.80
8.1.280.0100.01425.92
8.1.270.0130.00718.94
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0060.00322.45
8.1.230.0040.00820.90
8.1.220.0050.00317.74
8.1.210.0000.00819.10
8.1.200.0060.00617.35
8.1.190.0030.00617.35
8.1.180.0040.00418.10
8.1.170.0080.00018.65
8.1.160.0000.00822.02
8.1.150.0040.00418.89
8.1.140.0050.00217.45
8.1.130.0000.00717.80
8.1.120.0040.00417.32
8.1.110.0030.00517.35
8.1.100.0040.00417.50
8.1.90.0050.00317.48
8.1.80.0080.00017.29
8.1.70.0000.00717.46
8.1.60.0110.00017.57
8.1.50.0000.00717.54
8.1.40.0070.00417.45
8.1.30.0060.00317.55
8.1.20.0070.00017.66
8.1.10.0040.00417.55
8.1.00.0000.00817.43
8.0.300.0050.00219.89
8.0.290.0000.00716.63
8.0.280.0050.00218.37
8.0.270.0050.00317.26
8.0.260.0000.00717.18
8.0.250.0030.00316.86
8.0.240.0070.00016.86
8.0.230.0070.00016.97
8.0.220.0000.00716.93
8.0.210.0070.00016.91
8.0.200.0000.00616.97
8.0.190.0040.00416.96
8.0.180.0040.00416.96
8.0.170.0000.00816.79
8.0.160.0030.00316.89
8.0.150.0030.00616.84
8.0.140.0000.00716.86
8.0.130.0060.00013.25
8.0.120.0030.00516.75
8.0.110.0040.00416.82
8.0.100.0070.00016.84
8.0.90.0040.00416.79
8.0.80.0110.01116.87
8.0.70.0000.00716.67
8.0.60.0040.00416.77
8.0.50.0000.00716.94
8.0.30.0050.01617.05
8.0.20.0110.00917.40
8.0.10.0000.00717.00
8.0.00.0090.00816.98
7.4.330.0050.00015.20
7.4.320.0000.00616.61
7.4.300.0030.00316.58
7.4.290.0040.00416.61
7.4.280.0040.00416.62
7.4.270.0030.00316.52
7.4.260.0040.00316.56
7.4.250.0030.00516.38
7.4.240.0050.00216.60
7.4.230.0000.00716.45
7.4.220.0090.00916.65
7.4.210.0070.01016.52
7.4.200.0000.00716.54
7.4.160.0120.00316.35
7.4.150.0120.00917.40
7.4.140.0060.01417.86
7.4.130.0090.00916.50
7.4.120.0070.01016.37
7.4.110.0130.00616.58
7.4.100.0060.01016.61
7.4.90.0040.01216.66
7.4.80.0030.01319.39
7.4.70.0110.00616.77
7.4.60.0060.01516.43
7.4.50.0030.00316.61
7.4.40.0100.01016.49
7.4.30.0090.00916.71
7.4.00.0120.00315.15
7.3.330.0050.00013.23
7.3.320.0030.00313.43
7.3.310.0060.00316.34
7.3.300.0070.00016.20
7.3.290.0000.00616.19
7.3.280.0050.01116.35
7.3.270.0030.01417.40
7.3.260.0190.00416.43
7.3.250.0110.00916.61
7.3.240.0140.00616.41
7.3.230.0100.01316.39
7.3.210.0080.00816.63
7.3.200.0130.00819.39
7.3.190.0000.01516.38
7.3.180.0100.00616.50
7.3.170.0130.00716.50
7.3.160.0140.00716.46
7.3.00.0090.00616.68
7.2.330.0070.01116.79
7.2.320.0080.00916.71
7.2.310.0130.00316.60
7.2.300.0030.01216.83
7.2.290.0060.01216.48
7.2.130.0030.00917.09
7.2.120.0060.00916.84
7.2.110.0030.01016.70
7.2.100.0070.01017.01
7.2.90.0130.00316.81
7.2.80.0090.00616.91
7.2.70.0000.01216.67
7.2.60.0070.00816.96
7.2.50.0120.00816.92
7.2.40.0040.00817.13
7.2.30.0030.01016.72
7.2.20.0030.01016.65
7.2.10.0040.01116.93
7.2.00.0090.00917.04
7.1.250.0000.00815.45
7.1.240.0000.01415.78
7.1.230.0080.00815.93
7.1.220.0040.01115.67
7.1.210.0060.00615.78
7.1.200.0050.00615.77
7.1.190.0040.00415.83
7.1.180.0060.00315.86
7.1.170.0150.00015.70
7.1.160.0080.00815.86
7.1.150.0060.00615.91
7.1.140.0060.00615.95
7.1.130.0140.00315.95
7.1.120.0000.00915.83
7.1.110.0030.00915.45
7.1.100.0030.01015.80
7.1.90.0060.00316.03
7.1.80.0000.00815.89
7.1.70.0020.00716.55
7.1.60.0090.00717.63
7.1.50.0050.01616.42
7.1.40.0100.00715.96
7.1.30.0200.00015.69
7.1.20.0130.00015.63
7.1.10.0090.00315.48
7.1.00.0050.04019.17
7.0.330.0080.00315.20
7.0.320.0060.00914.98
7.0.310.0090.00315.30
7.0.300.0000.01115.17
7.0.290.0060.00615.36
7.0.280.0030.00915.27
7.0.270.0040.00415.08
7.0.260.0060.00615.32
7.0.250.0070.00315.20
7.0.240.0040.00715.39
7.0.230.0030.00615.35
7.0.220.0060.00615.61
7.0.210.0060.00615.25
7.0.200.0070.00516.00
7.0.190.0000.01315.49
7.0.180.0000.01015.38
7.0.170.0070.00715.21
7.0.160.0060.00915.41
7.0.150.0060.00915.38
7.0.140.0060.04018.63
7.0.130.0060.00615.43
7.0.120.0060.00315.33
7.0.110.0040.00815.44
7.0.100.0030.00715.09
7.0.90.0090.00615.13
7.0.80.0090.00615.07
7.0.70.0090.00315.10
7.0.60.0120.03017.67
7.0.50.0030.03916.57
7.0.40.0050.05016.84
7.0.30.0260.03916.83
7.0.20.0150.02316.69
7.0.10.0100.04216.69
7.0.00.0070.02216.70
5.6.380.0030.00914.24
5.6.370.0030.01314.14
5.6.360.0130.00014.06
5.6.350.0090.00614.23
5.6.340.0090.00614.40
5.6.330.0030.00914.25
5.6.320.0040.01114.67
5.6.310.0130.00014.63
5.6.300.0070.01014.45
5.6.290.0100.00314.25
5.6.280.0030.04017.64
5.6.270.0030.00914.33
5.6.260.0020.01014.66
5.6.250.0000.01414.58
5.6.240.0120.00314.40
5.6.230.0000.00814.40
5.6.220.0100.00014.14
5.6.210.0090.02017.43
5.6.200.0050.04516.35
5.6.190.0110.04017.42
5.6.180.0230.02717.44
5.6.170.0250.03517.54
5.6.160.0100.03016.22
5.6.150.0020.04416.38
5.6.140.0050.04816.10
5.6.130.0030.02616.12
5.6.120.0080.02117.55
5.6.110.0070.04517.70
5.6.100.0070.04217.73
5.6.90.0050.04517.62
5.6.80.0040.04717.22
5.6.70.0040.00813.90
5.6.60.0090.00314.02
5.6.50.0080.00513.98
5.6.40.0120.00314.37
5.6.30.0030.00814.46
5.6.20.0070.00714.24
5.6.10.0030.00914.16
5.6.00.0080.00513.96
5.5.380.0030.00611.27
5.5.370.0070.00311.35
5.5.360.0030.00311.16
5.5.350.0080.02515.71
5.5.340.0080.02714.62
5.5.330.0050.04315.63
5.5.320.0180.03215.79
5.5.310.0200.03915.57
5.5.300.0040.02714.60
5.5.290.0050.04614.48
5.5.280.0020.02615.90
5.5.270.0030.03516.04
5.5.260.0070.02915.88
5.5.250.0090.04115.80
5.5.240.1880.02215.58
5.5.230.0000.00610.93
5.5.220.0060.00610.90
5.5.210.0040.00710.90
5.5.200.0070.00710.99
5.5.190.0000.00910.90
5.5.180.0000.00911.05
5.5.170.0060.00610.90
5.5.160.0050.00510.90
5.5.150.0080.00010.90
5.5.140.0060.00710.90
5.5.130.0000.00810.99
5.5.120.0030.00610.90
5.5.110.0080.00411.45
5.5.100.0080.00511.15
5.5.90.0040.00411.11
5.5.80.0030.00610.90
5.5.70.0050.00511.12
5.5.60.0000.01210.90
5.5.50.0060.00610.90
5.5.40.0000.00711.05
5.5.30.0070.00010.91
5.5.20.0030.00611.15
5.5.10.0030.00710.90
5.5.00.0050.00511.10
5.4.450.0120.03715.20
5.4.440.0090.03015.21
5.4.430.0140.02515.31
5.4.420.0120.02715.12
5.4.410.0140.02515.20
5.4.400.0090.03015.10
5.4.390.0120.03314.89
5.4.380.0120.03714.89
5.4.370.0130.03014.97
5.4.360.0100.03114.72
5.4.350.0100.03514.84
5.4.340.0120.03014.72
5.4.330.0060.00611.26
5.4.320.0150.03514.91
5.4.310.0110.03214.95
5.4.300.0110.03014.92
5.4.290.0150.03014.76
5.4.280.0100.03414.72
5.4.270.0140.03114.74
5.4.260.0080.03314.79
5.4.250.0110.03214.73
5.4.240.0090.04314.80
5.4.230.0130.03014.75
5.4.220.0160.02714.88
5.4.210.0080.03714.83
5.4.200.0160.02413.84
5.4.190.0080.03314.72
5.4.180.0130.03014.95
5.4.170.0150.03214.86
5.4.160.0130.03514.94
5.4.150.0130.03814.89
5.4.140.0120.03713.92
5.4.130.0130.03413.91
5.4.120.0130.03813.76
5.4.110.0130.02313.77
5.4.100.0100.03913.87
5.4.90.0060.03213.60
5.4.80.0140.03213.76
5.4.70.0100.03413.65
5.4.60.0070.03513.66
5.4.50.0160.03013.56
5.4.40.0160.03313.73
5.4.30.0190.02913.69
5.4.20.0160.03513.82
5.4.10.0160.03413.69
5.4.00.0190.02413.40
5.3.290.0070.04412.87
5.3.280.0090.03312.82
5.3.270.0060.03412.85
5.3.260.0100.03512.76
5.3.250.0100.03012.76
5.3.240.0110.02812.86
5.3.230.0100.02812.76
5.3.220.0180.02712.73
5.3.210.0030.03912.82
5.3.200.0070.03312.75
5.3.190.0130.02812.80
5.3.180.0080.03012.82
5.3.170.0150.02512.74
5.3.160.0120.02812.74
5.3.150.0180.02212.75
5.3.140.0100.02812.72
5.3.130.0080.03312.75
5.3.120.0080.03012.84
5.3.110.0090.03412.82
5.3.100.0110.03812.48
5.3.90.0100.04212.53
5.3.80.0150.03712.49
5.3.70.0150.03212.53
5.3.60.0150.03512.51
5.3.50.0090.03712.45
5.3.40.0070.03912.48
5.3.30.0100.03812.41
5.3.20.0150.03312.38
5.3.10.0240.02512.30
5.3.00.0190.02712.29
5.2.170.0030.02811.04
5.2.160.0080.02511.05
5.2.150.0080.02511.08
5.2.140.0060.02311.01
5.2.130.0080.02311.03
5.2.120.0070.02711.04
5.2.110.0060.02511.06
5.2.100.0090.02411.03
5.2.90.0080.02311.05
5.2.80.0070.02711.06
5.2.70.0110.02911.06
5.2.60.0050.02810.98
5.2.50.0070.02311.01
5.2.40.0090.02010.96
5.2.30.0070.02510.94
5.2.20.0080.02110.96
5.2.10.0090.02210.88
5.2.00.0100.02410.82
5.1.60.0080.01710.50
5.1.50.0080.01710.46
5.1.40.0030.02510.53
5.1.30.0060.03010.73
5.1.20.0100.02510.65
5.1.10.0160.01810.50
5.1.00.0030.03110.53
5.0.50.0030.0199.77
5.0.40.0030.0199.72
5.0.30.0030.0289.61
5.0.20.0050.0169.62
5.0.10.0090.0129.56
5.0.00.0050.0299.60
4.4.90.0020.0158.40
4.4.80.0040.0188.43
4.4.70.0030.0158.40
4.4.60.0050.0128.38
4.4.50.0030.0198.41
4.4.40.0030.0278.39
4.4.30.0050.0138.39
4.4.20.0030.0178.43
4.4.10.0050.0138.47
4.4.00.0030.0248.48
4.3.110.0080.0128.36
4.3.100.0030.0148.38
4.3.90.0030.0178.34
4.3.80.0030.0258.36
4.3.70.0030.0138.38
4.3.60.0070.0128.34
4.3.50.0030.0168.36
4.3.40.0050.0188.32
4.3.30.0040.0137.74
4.3.20.0000.0167.74
4.3.10.0020.0147.70
4.3.00.0020.01410.08

preferences:
37 ms | 401 KiB | 5 Q