3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyElement extends DOMElement { public $id; public static $next = 0; function init() { $this->id = MyElement::$next++; echo "Initializing DOMElement #" . $this->id . ": " . $this->tagName . "\n"; return $this; } function __destruct() { echo "Destructing DOMElement #" . $this->id . ": " . $this->tagName . "\n"; } function info() { echo "Querying DOMElement #" . $this->id . ": " . $this->tagName . "\n"; } } function foo() { echo "Enter foo()\n"; $dom = new DOMDocument; $dom->registerNodeClass('DOMElement', 'MyElement'); $child = $dom->createElement('foo')->init(); $dom->appendChild($child); $dom->appendChild($dom->createElement('bar')->init()); echo "Leave foo()\n"; return [$dom, $child]; } function bar() { echo "Enter bar()\n"; list($d, $c) = foo(); $fooList = $d->getElementsByTagName('foo'); foreach ($fooList as $foo) { $foo->info(); } echo "Leave bar()\n"; } echo "Enter main()\n"; bar(); echo "Leave main()\n";

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.0150.00618.31
8.3.50.0150.00622.09
8.3.40.0080.01118.71
8.3.30.0110.00319.09
8.3.20.0040.00420.25
8.3.10.0030.00623.65
8.3.00.0080.00019.02
8.2.180.0100.01018.41
8.2.170.0150.00022.96
8.2.160.0110.00419.54
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00419.75
8.2.110.0090.00022.27
8.2.100.0090.00317.91
8.2.90.0000.00817.72
8.2.80.0100.00017.97
8.2.70.0000.00817.87
8.2.60.0000.00818.34
8.2.50.0040.00418.10
8.2.40.0050.00319.42
8.2.30.0000.00719.35
8.2.20.0050.00317.91
8.2.10.0040.00418.26
8.2.00.0070.00017.83
8.1.280.0150.00325.92
8.1.270.0040.00418.91
8.1.260.0000.00926.35
8.1.250.0000.00728.09
8.1.240.0040.00423.63
8.1.230.0070.00619.10
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0030.00617.35
8.1.180.0000.00918.10
8.1.170.0030.00518.77
8.1.160.0050.00218.80
8.1.150.0000.00719.02
8.1.140.0030.00617.47
8.1.130.0040.00417.94
8.1.120.0050.00317.54
8.1.110.0040.00417.57
8.1.100.0050.00317.32
8.1.90.0050.00217.45
8.1.80.0000.00817.47
8.1.70.0070.00017.55
8.1.60.0040.00417.58
8.1.50.0040.00417.60
8.1.40.0070.00017.59
8.1.30.0030.00617.70
8.1.20.0020.00517.73
8.1.10.0030.00517.63
8.1.00.0000.00817.62
8.0.300.0070.00019.64
8.0.290.0060.00316.63
8.0.280.0070.00018.44
8.0.270.0040.00417.34
8.0.260.0000.00617.24
8.0.250.0070.00017.01
8.0.240.0050.00216.95
8.0.230.0030.00316.96
8.0.220.0070.00016.89
8.0.210.0040.00416.86
8.0.200.0030.00616.87
8.0.190.0040.00417.05
8.0.180.0040.00416.91
8.0.170.0000.00816.89
8.0.160.0040.00416.82
8.0.150.0040.00416.83
8.0.140.0030.00316.87
8.0.130.0000.00613.30
8.0.120.0060.00316.87
8.0.110.0000.00716.92
8.0.100.0000.00716.80
8.0.90.0040.00416.75
8.0.80.0030.01317.01
8.0.70.0040.00416.84
8.0.60.0050.00317.08
8.0.50.0040.00416.71
8.0.30.0150.00417.21
8.0.20.0100.00917.40
8.0.10.0000.00717.13
8.0.00.0050.01316.88
7.4.330.0000.00615.14
7.4.320.0060.00016.55
7.4.300.0030.00316.45
7.4.290.0030.00316.52
7.4.280.0080.00016.47
7.4.270.0000.00616.68
7.4.260.0000.01016.71
7.4.250.0040.00416.49
7.4.240.0050.00216.58
7.4.230.0030.00316.66
7.4.220.0070.01116.59
7.4.210.0070.01016.54
7.4.200.0070.00016.70
7.4.160.0030.01216.51
7.4.150.0100.01317.40
7.4.140.0080.01017.86
7.4.130.0110.00916.63
7.4.120.0050.01116.54
7.4.110.0090.01516.52
7.4.100.0100.01016.70
7.4.90.0110.00616.58
7.4.80.0030.01519.39
7.4.70.0120.00416.46
7.4.60.0140.00716.76
7.4.50.0080.00016.61
7.4.40.0110.00616.65
7.4.30.0060.01116.70
7.4.00.0070.01015.12
7.3.330.0000.00513.28
7.3.320.0050.00013.40
7.3.310.0030.00516.44
7.3.300.0060.00016.33
7.3.290.0040.01116.46
7.3.280.0100.00916.37
7.3.270.0100.00717.40
7.3.260.0040.01316.61
7.3.250.0110.00816.38
7.3.240.0060.01116.61
7.3.230.0080.01116.39
7.3.210.0170.00616.45
7.3.200.0090.01519.39
7.3.190.0030.01316.63
7.3.180.0120.00316.61
7.3.170.0090.00916.75
7.3.160.0080.00816.60
7.3.10.0070.00716.54
7.3.00.0090.00016.54
7.2.330.0090.01516.89
7.2.320.0130.00316.83
7.2.310.0110.01216.52
7.2.300.0050.01416.92
7.2.290.0130.01016.59
7.2.130.0030.01316.68
7.2.120.0090.00017.01
7.2.110.0040.01116.95
7.2.100.0110.00317.02
7.2.90.0080.00317.01
7.2.80.0090.00917.11
7.2.70.0060.00317.12
7.2.60.0050.00917.03
7.2.50.0100.00316.86
7.2.40.0060.00916.72
7.2.30.0040.00717.06
7.2.20.0120.00316.70
7.2.10.0100.00716.83
7.2.00.0070.00817.92
7.1.250.0070.00315.55
7.1.200.0040.01115.50
7.1.100.0040.00818.12
7.1.70.0110.00016.94
7.1.60.0070.01719.22
7.1.50.0050.00516.87
7.1.00.0030.07722.44
7.0.200.0000.01016.68
7.0.140.0000.05722.11
7.0.60.0130.07319.99
7.0.50.0000.04317.90
7.0.40.0100.08020.18
7.0.30.0170.04320.09
7.0.20.0270.06020.24
7.0.10.0030.07320.01
7.0.00.0130.07720.22
5.6.280.0030.07320.89
5.6.210.0130.04720.75
5.6.200.0070.08318.18
5.6.190.0100.07720.49
5.6.180.0270.07320.48
5.6.170.0300.08320.71
5.6.160.0200.07020.52
5.6.150.0030.06318.22
5.6.140.0030.04018.27
5.6.130.0070.06018.18
5.6.120.0070.09321.05
5.6.110.0070.04321.17
5.6.100.0070.09321.10
5.6.90.0070.06721.10
5.6.80.0070.07720.54
5.6.70.4400.04020.42
5.5.350.0100.08320.41
5.5.340.0030.04018.08
5.5.330.0030.08720.21
5.5.320.0270.06020.38
5.5.310.0230.08020.34
5.5.300.0070.04718.07
5.5.290.0170.07318.02
5.5.280.0100.06021.01
5.5.270.0170.04720.77
5.5.260.0130.07320.79
5.5.250.0130.08020.78
5.5.240.0000.08320.29
5.4.450.0170.04319.41
5.4.440.0200.05019.57
5.4.430.0100.04319.16
5.4.420.0000.04019.41
5.4.410.0170.03719.41
5.4.400.0270.04018.84
5.4.390.0230.04018.95
5.4.380.0070.05019.20
5.4.370.0300.05019.00
5.4.360.0270.04318.99
5.4.350.0230.04318.87
5.4.340.0230.03319.21
5.4.320.0170.05718.99
5.4.310.0230.04019.08
5.4.300.0270.03018.87
5.4.290.0170.07019.14
5.4.280.0300.04018.86
5.4.270.0200.04319.13
5.4.260.0230.03719.33
5.4.250.0200.03718.98
5.4.240.0200.04718.86
5.4.230.0130.04319.18
5.4.220.0270.05319.07
5.4.210.0230.03719.23
5.4.200.0200.04718.94
5.4.190.0230.04019.21
5.4.180.0270.04718.97
5.4.170.0170.04019.12
5.4.160.0200.03719.11
5.4.150.0170.04018.82
5.4.140.0230.03016.39
5.4.130.0470.02316.56
5.4.120.0230.03016.52
5.4.110.0270.02716.23
5.4.100.0000.04016.24
5.4.90.0030.03316.58
5.4.80.0970.03716.49
5.4.70.1800.03016.44
5.4.60.1930.03316.53
5.4.50.1830.03316.55
5.4.40.1900.03316.23
5.4.30.1400.03316.50
5.4.20.0070.03016.52
5.4.10.0000.03716.27
5.4.00.1230.03715.80
5.3.290.1730.04714.77
5.3.280.1630.04014.59
5.3.270.1800.03714.60
5.3.260.1700.03314.71
5.3.250.1630.03314.54
5.3.240.0030.03714.73
5.3.230.0000.04014.60
5.3.220.0830.03314.58
5.3.210.1400.03714.58
5.3.200.1930.05314.67
5.3.190.1730.03714.52
5.3.180.1770.04014.71
5.3.170.1430.04314.51
5.3.160.1600.03714.50
5.3.150.1870.04014.56
5.3.140.1630.04014.57
5.3.130.1470.03714.50
5.3.120.1870.04714.66
5.3.110.1870.04014.58
5.3.100.0500.05013.99
5.3.90.0070.03714.13
5.3.80.0330.06314.05
5.3.70.1930.03713.95
5.3.60.1900.03713.93
5.3.50.1770.03313.95
5.3.40.1930.04313.98
5.3.30.2000.03714.01
5.3.20.2100.04313.94
5.3.10.2130.02713.66
5.3.00.1900.03313.66
5.2.170.1900.03011.29
5.2.160.1800.03011.17
5.2.150.1230.03011.14
5.2.140.0000.03711.10
5.2.130.0070.06011.09
5.2.120.0230.05711.05
5.2.110.1600.03011.05
5.2.100.1730.03311.11
5.2.90.1700.03311.21
5.2.80.1800.03311.34
5.2.70.1770.03711.13
5.2.60.1830.03311.02
5.2.50.1870.03311.05
5.2.40.1500.02710.93
5.2.30.1500.03011.00
5.2.20.1470.03311.04
5.2.10.1270.02711.00
5.2.00.1530.03710.64
5.1.60.0030.0539.95
5.1.50.0100.03710.17
5.1.40.0030.04710.05
5.1.30.0230.04010.29
5.1.20.1370.02310.43
5.1.10.1230.0279.98
5.1.00.1700.02310.23
5.0.50.0670.0208.48
5.0.40.0670.0178.34
5.0.30.0700.0378.14
5.0.20.0830.0278.22
5.0.10.0630.0208.13
5.0.00.0800.0378.31
4.4.90.0600.0207.44
4.4.80.0730.0207.44
4.4.70.0630.0137.44
4.4.60.0670.0177.44
4.4.50.0700.0107.44
4.4.40.0770.0307.44
4.4.30.0630.0177.44
4.4.20.0830.0207.44
4.4.10.0700.0107.44
4.4.00.0770.0307.44
4.3.110.0330.0207.44
4.3.100.0000.0177.44
4.3.90.0000.0177.44
4.3.80.0070.0237.44
4.3.70.0030.0137.44
4.3.60.0030.0137.44
4.3.50.0030.0207.44
4.3.40.0000.0277.44
4.3.30.0030.0137.44
4.3.20.0400.0237.44
4.3.10.0330.0177.44
4.3.00.0370.0177.44

preferences:
33.06 ms | 401 KiB | 5 Q