3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dom = null; $dt = null; $impl = null; function doThing() { $my_arr = []; global $dom,$dt,$impl; for($x = 0; $x < 7; $x++) { $dom = new \DOMDocument(); $dom->loadHTML("<!DOCTYPE html><p>hello</p>"); $impl = new \DOMImplementation(); $dt = $impl->createDocumentType("html", "", ""); array_push($my_arr, $dt, $dom, $impl); } $dom = new \DOMDocument(); $dom->loadHTML("<!DOCTYPE html><p>hello</p>"); $impl = new \DOMImplementation(); $dt = $impl->createDocumentType("html", "", ""); } //gc_collect_cycles(); doThing(); gc_collect_cycles(); $dom->replaceChild($dt, $dom->doctype); // FREE THE FIRST TIME! doThing(); // fill up tcache; coimment this out for tcache double free malding gc_collect_cycles(); // FREE AGAIN

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.0040.01816.63
8.3.50.0110.00716.75
8.3.40.0090.00918.79
8.3.30.0160.00318.67
8.3.20.0000.00824.18
8.3.10.0090.00024.66
8.3.00.0050.00326.16
8.2.180.0120.00925.92
8.2.170.0150.00619.08
8.2.160.0110.00422.96
8.2.150.0070.00025.66
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0000.00826.35
8.2.110.0090.00022.41
8.2.100.0070.00717.91
8.2.90.0000.00817.75
8.2.80.0050.00518.95
8.2.70.0030.00617.75
8.2.60.0030.00617.93
8.2.50.0000.00918.07
8.2.40.0030.00518.43
8.2.30.0000.00718.23
8.2.20.0060.00319.36
8.2.10.0050.00319.45
8.2.00.0020.00519.51
8.1.280.0120.00625.92
8.1.270.0000.00824.04
8.1.260.0040.00428.09
8.1.250.0000.00728.09
8.1.240.0070.00422.27
8.1.230.0040.00821.13
8.1.220.0000.00817.91
8.1.210.0040.00418.77
8.1.200.0000.00817.38
8.1.190.0070.00319.39
8.1.180.0000.00818.10
8.1.170.0040.00418.80
8.1.160.0060.00318.99
8.1.150.0000.00819.02
8.1.140.0000.00719.15
8.1.130.0000.00720.18
8.1.120.0100.00017.60
8.1.110.0050.00517.63
8.1.100.0080.00417.54
8.1.90.0050.00717.61
8.1.80.0090.00317.64
8.1.70.0120.00117.64
8.1.60.0100.00317.83
8.1.50.0110.00317.80
8.1.40.0110.00317.82
8.1.30.0120.00217.86
8.1.20.0120.00117.89
8.1.10.0080.00417.87
8.1.00.0090.00317.79
8.0.300.0040.00418.77
8.0.290.0050.00316.88
8.0.280.0070.00018.52
8.0.270.0030.00318.09
8.0.260.0000.00818.59
8.0.250.0030.00317.13
8.0.240.0090.00217.02
8.0.230.0040.00717.03
8.0.220.0070.00316.86
8.0.210.0090.00217.00
8.0.200.0100.00116.95
8.0.190.0070.00416.96
8.0.180.0070.00516.98
8.0.170.0090.00316.94
8.0.160.0000.01117.02
8.0.150.0100.00216.91
8.0.140.0040.00516.92
8.0.130.0020.00815.77
8.0.120.0030.00716.88
8.0.110.0060.00316.87
8.0.100.0060.00316.95
8.0.90.0050.00416.92
8.0.80.0080.00416.89
8.0.70.0050.00416.90
8.0.60.0050.00416.90
8.0.50.0030.00616.90
8.0.30.0050.00616.87
8.0.20.0060.00716.96
8.0.10.0070.00617.02
8.0.00.0070.00517.03
7.4.330.0050.00015.55
7.4.320.0070.00516.62
7.4.300.0100.00216.58
7.4.290.0060.00516.45
7.4.280.0080.00116.46
7.4.270.0030.00416.59
7.4.260.0050.00315.53
7.4.250.0020.00716.52
7.4.240.0070.00116.55
7.4.230.0040.00516.62
7.4.220.0060.00416.65
7.4.210.0080.00416.65
7.4.200.0040.00516.64
7.4.190.0060.00316.56
7.4.180.0070.00416.69
7.4.160.0060.00516.71
7.4.150.0070.00316.51
7.4.140.0050.00516.44
7.4.130.0050.00516.62
7.4.120.0050.00516.48
7.4.110.0050.00416.62
7.4.100.0020.00916.62
7.4.90.0020.00716.64
7.4.80.0060.00516.59
7.4.70.0050.00616.64
7.4.60.0030.00716.51
7.4.50.0050.00716.50
7.4.40.0050.00616.41
7.4.30.0070.00416.52
7.4.20.0050.00616.55
7.4.10.0050.00516.56
7.4.00.0060.00416.58
7.3.330.0110.00416.50
7.3.320.0100.00515.45
7.3.310.0130.00416.46
7.3.300.0110.00316.40
7.3.290.0090.00616.42
7.3.280.0070.00816.46
7.3.270.0070.00816.44
7.3.260.0100.00416.43
7.3.250.0090.00616.40
7.3.240.0110.00316.48
7.3.230.0110.00616.46
7.3.220.0080.00716.37
7.3.210.0120.00416.36
7.3.200.0100.00616.35
7.3.190.0110.00516.36
7.3.180.0110.00316.36
7.3.170.0080.00616.39
7.3.160.0090.00616.33
7.3.150.0120.00316.40
7.3.140.0080.00716.32
7.3.130.0090.00416.38
7.3.120.0110.00316.35
7.3.110.0090.00616.33
7.3.100.0100.00516.31
7.3.90.0100.00516.64
7.3.80.0090.00516.35
7.3.70.0100.00416.42
7.3.60.0110.00316.53
7.3.50.0080.00716.58
7.3.40.0090.00416.56
7.3.30.0090.00516.52
7.3.20.0100.00617.45
7.3.10.0090.00617.42
7.3.00.0080.00617.40

preferences:
46.28 ms | 401 KiB | 5 Q