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(); $grandchild = $dom->createElement('bar')->init(); $greatgrandchild = $dom->createElement('fiz')->init(); $grandchild->appendChild($greatgrandchild); $child->appendChild($grandchild); $dom->appendChild($child); echo "Leave foo()\n"; return $grandchild; } function bar() { echo "Enter bar()\n"; $g = foo(); $fooList = $g->getElementsByTagName('fiz'); foreach ($fooList as $foo) { $foo->info(); var_dump($foo->getNodePath()); } 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.0080.00818.55
8.3.50.0110.00918.05
8.3.40.0170.00318.87
8.3.30.0030.01218.92
8.3.20.0000.00720.04
8.3.10.0040.00423.57
8.3.00.0060.00318.86
8.2.180.0070.00718.29
8.2.170.0070.00722.96
8.2.160.0100.00722.13
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0040.00419.70
8.2.110.0030.00621.18
8.2.100.0120.00017.84
8.2.90.0030.00620.90
8.2.80.0060.00318.05
8.2.70.0040.00417.75
8.2.60.0040.00418.05
8.2.50.0040.00418.07
8.2.40.0000.00818.34
8.2.30.0000.00718.30
8.2.20.0000.00817.87
8.2.10.0040.00418.30
8.2.00.0040.00417.86
8.1.280.0170.00325.92
8.1.270.0080.00019.02
8.1.260.0000.00826.35
8.1.250.0000.00828.09
8.1.240.0120.00020.95
8.1.230.0040.00721.16
8.1.220.0080.00018.03
8.1.210.0040.00418.85
8.1.200.0000.00917.25
8.1.190.0030.00617.66
8.1.180.0050.00318.10
8.1.170.0030.00618.96
8.1.160.0000.00818.97
8.1.150.0070.00018.93
8.1.140.0000.00817.57
8.1.130.0040.00417.82
8.1.120.0050.00217.57
8.1.110.0000.00717.63
8.1.100.0070.00017.52
8.1.90.0040.00417.55
8.1.80.0070.00017.58
8.1.70.0070.00017.46
8.1.60.0000.00817.66
8.1.50.0040.00417.56
8.1.40.0000.00817.47
8.1.30.0030.00517.71
8.1.20.0000.00817.76
8.1.10.0030.00517.62
8.1.00.0050.00317.54
8.0.300.0040.00420.16
8.0.290.0000.00716.88
8.0.280.0070.00018.46
8.0.270.0000.00717.17
8.0.260.0040.00417.36
8.0.250.0000.00717.00
8.0.240.0030.00616.98
8.0.230.0030.00317.00
8.0.220.0070.00016.98
8.0.210.0030.00316.94
8.0.200.0070.00017.03
8.0.190.0000.00916.98
8.0.180.0040.00416.94
8.0.170.0030.00616.84
8.0.160.0040.00417.02
8.0.150.0040.00416.90
8.0.140.0060.00316.95
8.0.130.0050.00013.48
8.0.120.0030.00516.88
8.0.110.0040.00416.91
8.0.100.0000.00717.13
8.0.90.0070.00016.93
8.0.80.0140.00716.88
8.0.70.0040.00416.92
8.0.60.0040.00416.84
8.0.50.0040.00416.85
8.0.30.0100.01417.04
8.0.20.0110.01117.40
8.0.10.0000.00816.96
8.0.00.0130.00616.88
7.4.330.0060.00015.13
7.4.320.0030.00316.54
7.4.300.0000.00616.48
7.4.290.0020.00516.53
7.4.280.0040.00416.66
7.4.270.0030.00316.64
7.4.260.0030.00716.43
7.4.250.0000.00716.51
7.4.240.0050.00216.64
7.4.230.0000.00816.55
7.4.220.0130.00616.43
7.4.210.0070.01016.53
7.4.200.0070.00016.49
7.4.160.0120.00916.42
7.4.150.0120.00617.40
7.4.140.0090.00917.86
7.4.130.0070.01016.63
7.4.120.0060.01216.62
7.4.110.0100.01316.63
7.4.100.0050.01716.49
7.4.90.0090.00916.52
7.4.80.0110.00719.39
7.4.70.0060.01116.41
7.4.60.0120.00616.32
7.4.50.0030.00616.56
7.4.40.0130.01016.71
7.4.30.0080.00816.58
7.4.00.0060.00915.09
7.3.330.0000.00613.38
7.3.320.0030.00313.38
7.3.310.0000.00816.39
7.3.300.0030.00316.42
7.3.290.0060.00916.37
7.3.280.0090.00916.33
7.3.270.0110.00817.40
7.3.260.0110.00816.55
7.3.250.0120.00916.67
7.3.240.0150.00616.69
7.3.230.0090.01516.75
7.3.210.0140.00316.39
7.3.200.0030.01919.39
7.3.190.0060.01016.34
7.3.180.0080.01116.48
7.3.170.0070.01016.46
7.3.160.0130.00316.42
7.3.10.0030.01016.70
7.3.00.0060.00616.80
7.2.330.0060.01216.85
7.2.320.0070.01116.75
7.2.310.0120.00816.79
7.2.300.0160.00016.71
7.2.290.0130.00716.84
7.2.130.0120.00316.95
7.2.120.0060.00617.01
7.2.110.0110.00416.89
7.2.100.0100.00316.70
7.2.90.0030.01216.97
7.2.80.0040.01116.94
7.2.70.0000.01416.77
7.2.60.0060.00616.94
7.2.50.0090.00616.82
7.2.40.0170.00316.88
7.2.30.0070.00717.12
7.2.20.0070.01117.16
7.2.10.0040.01116.92
7.2.00.0080.00818.24
7.1.250.0030.01015.73
7.1.200.0030.01015.68
7.1.100.0040.01218.34
7.1.70.0060.00317.12
7.1.60.0100.01019.22
7.1.50.0050.00516.90
7.1.00.0070.07022.48
7.0.200.0060.00316.84
7.0.140.0030.03722.09
7.0.60.0070.08019.98
7.0.50.0130.05017.96
7.0.40.0200.04720.22
7.0.30.0600.06320.26
7.0.20.0270.03020.15
7.0.10.0070.09020.33
7.0.00.0230.07020.18
5.6.280.0000.07321.16
5.6.210.0170.05320.79
5.6.200.0030.05718.25
5.6.190.0100.08720.63
5.6.180.0300.03320.33
5.6.170.0230.04720.50
5.6.160.0070.05720.54
5.6.150.0070.04718.14
5.6.140.0200.04718.18
5.6.130.0070.05018.17
5.6.120.0070.08721.02
5.6.110.0070.07721.00
5.6.100.0100.08721.00
5.6.90.0100.05321.06
5.6.80.0200.04320.36
5.6.70.0430.06320.52
5.5.350.0030.03020.47
5.5.340.0000.06318.02
5.5.330.0100.07320.27
5.5.320.0070.04720.42
5.5.310.0300.05020.34
5.5.300.0130.07017.99
5.5.290.0100.07717.98
5.5.280.0070.05320.99
5.5.270.0100.06020.79
5.5.260.0170.07320.91
5.5.250.0130.07020.64
5.5.240.0030.07320.26
5.4.450.0230.05719.59
5.4.440.0770.06019.23
5.4.430.0600.05719.49
5.4.420.0500.05019.54
5.4.410.0830.05019.51
5.4.400.0670.05319.03
5.4.390.0730.06019.32
5.4.380.0270.05318.56
5.4.370.0230.05718.79
5.4.360.0330.07018.75
5.4.350.0200.06718.75
5.4.340.0130.05718.77
5.4.320.0170.05718.70
5.4.310.0130.05318.70
5.4.300.0330.05318.78
5.4.290.0170.06318.70
5.4.280.0270.05718.48
5.4.270.0270.05318.80
5.4.260.0370.05018.83
5.4.250.0330.05718.78
5.4.240.0370.06018.80
5.4.230.0330.06318.75
5.4.220.0330.05318.63
5.4.210.0270.05718.64
5.4.200.0370.04316.66
5.4.190.0270.06018.51
5.4.180.0400.04718.69
5.4.170.0230.06318.77
5.4.160.0270.05718.59
5.4.150.0330.06718.60
5.4.140.0300.05716.30
5.4.130.0330.04316.29
5.4.120.0330.05016.45
5.4.110.0500.04716.23
5.4.100.0270.05316.45
5.4.90.0430.05016.46
5.4.80.0300.05016.33
5.4.70.0230.05716.43
5.4.60.0370.05716.26
5.4.50.0270.06016.23
5.4.40.0400.06716.29
5.4.30.0330.05316.29
5.4.20.0370.04716.15
5.4.10.0270.05716.16
5.4.00.0470.05715.70
5.3.290.0330.07014.68
5.3.280.0230.05714.68
5.3.270.0230.05714.80
5.3.260.0330.05314.68
5.3.250.0330.07014.68
5.3.240.0300.05014.78
5.3.230.0330.04714.64
5.3.220.0270.05314.69
5.3.210.0200.06014.62
5.3.200.0330.04314.61
5.3.190.0270.05314.78
5.3.180.0270.05314.81
5.3.170.0300.05014.73
5.3.160.0270.05014.61
5.3.150.0300.05314.63
5.3.140.0300.05014.64
5.3.130.0370.05714.80
5.3.120.0430.05014.80
5.3.110.0370.05314.60
5.3.100.0200.08014.11
5.3.90.0270.05014.03
5.3.80.0200.05714.21
5.3.70.0270.06014.12
5.3.60.0270.06714.08
5.3.50.0370.05014.20
5.3.40.0300.05313.97
5.3.30.0300.06713.96
5.3.20.0330.04713.76
5.3.10.0300.05313.80
5.3.00.0230.06713.73
5.2.170.0330.03711.25
5.2.160.0170.04711.16
5.2.150.0270.03711.18
5.2.140.0200.04711.30
5.2.130.0230.04311.13
5.2.120.0230.03711.24
5.2.110.0170.04711.37
5.2.100.0270.05711.26
5.2.90.0130.05311.21
5.2.80.0200.04311.24
5.2.70.0200.05711.16
5.2.60.0170.05311.30
5.2.50.0200.04311.15
5.2.40.0230.03711.12
5.2.30.0170.04311.23
5.2.20.0230.03711.16
5.2.10.0200.04010.89
5.2.00.0230.04310.85
5.1.60.0230.02710.12
5.1.50.0300.03310.14
5.1.40.0100.04310.20
5.1.30.0270.03310.42
5.1.20.0130.05010.44
5.1.10.0130.04010.09
5.1.00.0170.04010.13
5.0.50.0130.0278.62
5.0.40.0070.0308.52
5.0.30.0070.0478.38
5.0.20.0130.0238.24
5.0.10.0070.0308.31
5.0.00.0070.0508.38
4.4.90.0130.0207.21
4.4.80.0100.0207.21
4.4.70.0070.0277.21
4.4.60.0130.0177.21
4.4.50.0030.0277.21
4.4.40.0100.0337.21
4.4.30.0070.0237.21
4.4.20.0100.0207.21
4.4.10.0130.0207.21
4.4.00.0130.0407.21
4.3.110.0100.0207.21
4.3.100.0100.0207.21
4.3.90.0070.0237.21
4.3.80.0100.0337.21
4.3.70.0030.0277.21
4.3.60.0070.0237.21
4.3.50.0170.0137.21
4.3.40.0070.0337.21
4.3.30.0030.0237.21
4.3.20.0000.0277.21
4.3.10.0070.0207.21
4.3.00.0100.0137.58

preferences:
29.35 ms | 400 KiB | 5 Q