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('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.0100.01018.55
8.3.50.0120.00921.92
8.3.40.0170.00318.75
8.3.30.0090.00618.95
8.3.20.0040.00420.34
8.3.10.0000.00823.67
8.3.00.0050.00318.86
8.2.180.0060.00918.54
8.2.170.0070.00722.96
8.2.160.0070.01022.13
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0040.00419.66
8.2.110.0030.00622.20
8.2.100.0130.00017.84
8.2.90.0050.00317.75
8.2.80.0000.00818.05
8.2.70.0030.00518.04
8.2.60.0050.00318.03
8.2.50.0070.00318.10
8.2.40.0050.00321.00
8.2.30.0050.00519.32
8.2.20.0070.00017.82
8.2.10.0030.00518.04
8.2.00.0030.00617.91
8.1.280.0100.01025.92
8.1.270.0040.00418.83
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00023.96
8.1.230.0090.00320.79
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0080.00017.23
8.1.180.0060.00318.10
8.1.170.0050.00318.50
8.1.160.0040.00419.16
8.1.150.0000.00718.91
8.1.140.0040.00417.44
8.1.130.0000.00917.69
8.1.120.0050.00217.58
8.1.110.0030.00617.51
8.1.100.0070.00017.45
8.1.90.0050.00317.50
8.1.80.0020.00517.55
8.1.70.0000.00717.50
8.1.60.0060.00317.63
8.1.50.0030.00517.54
8.1.40.0050.00217.55
8.1.30.0050.00317.75
8.1.20.0070.00317.66
8.1.10.0040.00417.52
8.1.00.0080.00017.48
8.0.300.0000.00719.54
8.0.290.0040.00416.88
8.0.280.0030.00318.60
8.0.270.0040.00417.30
8.0.260.0040.00417.36
8.0.250.0030.00316.97
8.0.240.0080.00017.07
8.0.230.0040.00416.97
8.0.220.0000.00817.00
8.0.210.0070.00016.89
8.0.200.0000.00616.96
8.0.190.0040.00416.96
8.0.180.0050.00316.90
8.0.170.0040.00416.90
8.0.160.0000.00717.05
8.0.150.0030.00616.93
8.0.140.0080.00016.83
8.0.130.0050.00013.36
8.0.120.0040.00416.90
8.0.110.0000.00717.03
8.0.100.0000.00716.77
8.0.90.0000.00716.90
8.0.80.0070.01016.89
8.0.70.0070.00017.01
8.0.60.0000.00716.74
8.0.50.0000.00816.79
8.0.30.0110.01116.99
8.0.20.0130.00917.40
8.0.10.0040.00417.07
8.0.00.0110.00916.76
7.4.330.0050.00015.14
7.4.320.0030.00316.55
7.4.300.0030.00316.56
7.4.290.0030.00316.50
7.4.280.0000.00716.55
7.4.270.0030.00316.65
7.4.260.0100.00016.70
7.4.250.0080.00016.50
7.4.240.0030.00416.59
7.4.230.0000.00716.74
7.4.220.0130.00716.44
7.4.210.0140.00716.71
7.4.200.0000.00716.64
7.4.160.0140.01016.60
7.4.150.0080.01217.40
7.4.140.0110.00717.86
7.4.130.0110.01116.52
7.4.120.0060.01116.63
7.4.110.0160.00716.61
7.4.100.0090.01516.73
7.4.90.0100.00716.62
7.4.80.0100.01019.39
7.4.70.0120.00616.72
7.4.60.0030.01416.51
7.4.50.0000.00816.70
7.4.40.0090.00916.77
7.4.30.0120.00416.59
7.4.00.0060.00915.06
7.3.330.0030.00413.20
7.3.320.0000.00613.24
7.3.310.0030.00516.38
7.3.300.0030.00316.43
7.3.290.0080.00816.36
7.3.280.0090.00916.33
7.3.270.0090.00917.40
7.3.260.0060.01216.39
7.3.250.0130.00816.66
7.3.240.0130.00516.52
7.3.230.0130.00416.79
7.3.210.0080.00916.42
7.3.200.0090.01219.39
7.3.190.0090.00916.43
7.3.180.0220.00316.38
7.3.170.0130.00616.41
7.3.160.0060.01016.46
7.2.330.0100.00916.49
7.2.320.0100.01016.52
7.2.310.0100.01016.50
7.2.300.0030.01316.77
7.2.290.0070.01816.75
7.2.60.0060.00616.88
7.1.200.0060.00315.88
7.1.100.0040.00418.09
7.1.70.0070.00317.10
7.1.60.0170.00719.22
7.1.50.0110.00017.07
7.1.00.0000.08022.54
7.0.200.0000.01016.52
7.0.140.0000.05322.07
7.0.60.0070.04020.00
7.0.50.0030.04317.89
7.0.40.0100.07020.04
7.0.30.0230.03720.16
7.0.20.0230.08020.25
7.0.10.0070.04020.21
7.0.00.0100.08020.09
5.6.280.0030.07321.07
5.6.210.0100.07720.53
5.6.200.0100.06018.21
5.6.190.0030.04320.68
5.6.180.0230.07320.39
5.6.170.0270.04720.39
5.6.160.0030.05720.57
5.6.150.0100.07718.21
5.6.140.0070.03718.18
5.6.130.0030.04718.17
5.6.120.0070.08321.02
5.6.110.0070.08721.14
5.6.100.0170.06721.01
5.6.90.0000.04321.00
5.6.80.0100.04720.43
5.5.350.0170.08020.44
5.5.340.0000.04318.07
5.5.330.0100.07720.47
5.5.320.0200.07720.51
5.5.310.0170.06720.21
5.5.300.0000.06017.93
5.5.290.0100.06017.98
5.5.280.0030.08720.88
5.5.270.0100.08020.82
5.5.260.0100.07720.99
5.5.250.0170.05720.58
5.5.240.0070.06720.16
5.4.450.0100.06319.20
5.4.440.0730.05019.24
5.4.430.0600.05319.43
5.4.420.0670.05019.45
5.4.410.0830.05319.32
5.4.400.0770.05019.16
5.4.390.0770.05319.32
5.4.380.0470.04318.53
5.4.370.0270.06018.74
5.4.360.0300.06318.62
5.4.350.0330.05718.72
5.4.340.0370.05318.76
5.4.320.0300.06018.85
5.4.310.0400.05718.72
5.4.300.0370.07318.58
5.4.290.0370.05318.79
5.4.280.0370.06318.59
5.4.270.0300.06318.83
5.4.260.0270.05718.64
5.4.250.0400.06018.61
5.4.240.0400.05018.78
5.4.230.0170.06018.76
5.4.220.0300.05318.54
5.4.210.0200.06018.76
5.4.200.0170.05716.61
5.4.190.0170.06318.79
5.4.180.0370.05718.75
5.4.170.0630.06018.73
5.4.160.0300.05718.48
5.4.150.0370.06018.79
5.4.140.0430.07316.31
5.4.130.0330.06016.46
5.4.120.0400.05716.37
5.4.110.0300.06716.46
5.4.100.0470.06316.33
5.4.90.0300.07716.27
5.4.80.0470.04016.20
5.4.70.0230.05316.41
5.4.60.0400.05016.33
5.4.50.0270.06016.23
5.4.40.0300.07316.29
5.4.30.0400.06016.29
5.4.20.0330.08316.23
5.4.10.0500.07016.40
5.4.00.0400.06315.76
5.3.290.0430.05314.68
5.3.280.0330.06014.79
5.3.270.0400.06014.81
5.3.260.0300.05314.73
5.3.250.0370.04314.63
5.3.240.0330.04314.70
5.3.230.0230.06014.73
5.3.220.0270.05714.70
5.3.210.0400.05714.81
5.3.200.0400.06314.63
5.3.190.0430.05014.64
5.3.180.0470.05014.75
5.3.170.0370.05714.58
5.3.160.0330.05714.68
5.3.150.0330.04714.71
5.3.140.0500.06014.75
5.3.130.0230.06014.63
5.3.120.0300.05314.70
5.3.110.0370.05314.59
5.3.100.0270.05314.25
5.3.90.0370.04714.07
5.3.80.0300.06014.09
5.3.70.0270.06014.21
5.3.60.0330.05014.06
5.3.50.0330.04714.02
5.3.40.0330.06314.07
5.3.30.0300.06713.96
5.3.20.0370.04713.75
5.3.10.0200.06013.71
5.3.00.0430.06013.79
5.2.170.0430.05011.23
5.2.160.0370.06011.38
5.2.150.0230.06711.30
5.2.140.0300.06311.29
5.2.130.0330.05311.15
5.2.120.0400.05011.34
5.2.110.0470.05011.24
5.2.100.0330.06311.25
5.2.90.0370.03711.23
5.2.80.0270.05011.33
5.2.70.0370.06311.15
5.2.60.0400.05311.13
5.2.50.0370.05311.04
5.2.40.0170.06011.08
5.2.30.0230.05011.12
5.2.20.0300.03311.00
5.2.10.0200.04010.96
5.2.00.0170.04710.86
5.1.60.0200.03310.23
5.1.50.0270.03310.21
5.1.40.0270.04710.00
5.1.30.0230.04310.36
5.1.20.0100.05710.60
5.1.10.0230.05010.21
5.1.00.0370.03310.11
5.0.50.0200.0238.66
5.0.40.0200.0238.48
5.0.30.0030.0508.23
5.0.20.0100.0308.34
5.0.10.0130.0278.40
5.0.00.0130.0438.25
4.4.90.0070.0237.11
4.4.80.0100.0237.11
4.4.70.0200.0307.11
4.4.60.0200.0307.11
4.4.50.0200.0207.11
4.4.40.0130.0407.11
4.4.30.0170.0237.11
4.4.20.0070.0337.11
4.4.10.0130.0237.11
4.4.00.0070.0407.11
4.3.110.0170.0237.11
4.3.100.0030.0307.11
4.3.90.0100.0277.11
4.3.80.0030.0377.11
4.3.70.0130.0207.11
4.3.60.0030.0277.11
4.3.50.0130.0207.11
4.3.40.0100.0337.11
4.3.30.0100.0237.11
4.3.20.0030.0307.11
4.3.10.0170.0177.11
4.3.00.0070.0207.58

preferences:
32.72 ms | 401 KiB | 5 Q