3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyElement extends DOMElement { public $id; public static $next = 0; function init() { $this->id = MyText::$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.0100.01018.56
8.3.50.0100.01221.96
8.3.40.0130.00718.76
8.3.30.0140.00019.14
8.3.20.0070.00020.26
8.3.10.0080.00023.44
8.3.00.0040.00419.08
8.2.180.0110.00718.63
8.2.170.0060.01222.96
8.2.160.0030.01019.28
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00019.79
8.2.110.0070.00322.08
8.2.100.0080.00417.97
8.2.90.0030.00918.15
8.2.80.0030.00718.05
8.2.70.0030.00618.03
8.2.60.0000.00818.03
8.2.50.0050.00318.10
8.2.40.0060.00319.38
8.2.30.0000.00819.26
8.2.20.0050.00317.86
8.2.10.0040.00418.27
8.2.00.0030.00517.88
8.1.280.0120.00325.92
8.1.270.0080.00018.83
8.1.260.0000.00926.35
8.1.250.0070.00028.09
8.1.240.0150.00622.14
8.1.230.0070.00420.97
8.1.220.0040.00417.78
8.1.210.0060.00318.77
8.1.200.0000.00917.22
8.1.190.0060.00317.35
8.1.180.0000.00818.10
8.1.170.0040.00418.63
8.1.160.0040.00418.95
8.1.150.0080.00018.83
8.1.140.0070.00017.56
8.1.130.0030.00617.82
8.1.120.0070.00017.52
8.1.110.0080.00017.45
8.1.100.0030.00317.44
8.1.90.0000.00817.43
8.1.80.0000.00717.50
8.1.70.0070.00017.47
8.1.60.0000.00817.57
8.1.50.0060.00317.56
8.1.40.0040.00417.61
8.1.30.0040.00417.59
8.1.20.0050.00217.62
8.1.10.0040.00417.57
8.1.00.0060.00317.59
8.0.300.0040.00419.73
8.0.290.0000.00916.63
8.0.280.0000.00718.52
8.0.270.0080.00017.23
8.0.260.0030.00317.26
8.0.250.0000.00717.01
8.0.240.0000.00716.98
8.0.230.0070.00017.01
8.0.220.0030.00317.02
8.0.210.0030.00417.02
8.0.200.0030.00617.08
8.0.190.0000.00716.98
8.0.180.0050.00217.06
8.0.170.0040.00417.02
8.0.160.0030.00517.02
8.0.150.0080.00016.86
8.0.140.0000.00716.94
8.0.130.0030.00313.40
8.0.120.0040.00416.89
8.0.110.0000.00816.95
8.0.100.0030.00516.83
8.0.90.0040.00417.16
8.0.80.0080.00817.02
8.0.70.0000.00717.10
8.0.60.0050.00317.07
8.0.50.0000.00717.15
8.0.30.0090.01117.03
8.0.20.0160.00517.40
8.0.10.0040.00416.91
8.0.00.0060.01116.69
7.4.330.0000.00515.09
7.4.320.0070.00016.54
7.4.300.0000.00716.63
7.4.290.0030.00316.69
7.4.280.0000.00816.53
7.4.270.0000.00716.61
7.4.260.0030.00416.53
7.4.250.0000.00716.50
7.4.240.0020.00516.55
7.4.230.0040.00416.38
7.4.220.0120.00616.59
7.4.210.0100.00616.48
7.4.200.0040.00316.78
7.4.160.0110.00416.78
7.4.150.0150.00317.40
7.4.140.0060.01117.86
7.4.130.0080.01016.50
7.4.120.0070.01016.56
7.4.110.0190.00316.46
7.4.100.0110.01416.67
7.4.90.0090.00916.45
7.4.80.0130.00919.39
7.4.70.0060.01016.48
7.4.60.0060.00916.36
7.4.50.0040.00416.35
7.4.40.0090.01216.52
7.4.30.0110.00616.62
7.4.00.0110.00715.00
7.3.330.0000.00513.27
7.3.320.0050.00013.47
7.3.310.0070.00016.43
7.3.300.0030.00316.45
7.3.290.0100.00816.46
7.3.280.0080.00816.48
7.3.270.0140.00417.40
7.3.260.0000.01716.48
7.3.250.0110.00616.34
7.3.240.0140.00316.50
7.3.230.0080.01116.47
7.3.210.0130.00316.32
7.3.200.0120.00619.39
7.3.190.0030.01316.63
7.3.180.0060.00916.65
7.3.170.0080.01116.55
7.3.160.0090.00616.43
7.2.330.0170.00016.89
7.2.320.0130.00316.84
7.2.310.0080.01116.92
7.2.300.0130.00316.75
7.2.290.0120.01216.50
7.2.60.0090.00616.97
7.2.00.0070.00719.58
7.1.200.0030.00615.70
7.1.100.0000.01117.79
7.1.70.0000.01216.90
7.1.60.0110.01419.22
7.1.50.0220.01134.84
7.1.00.0070.07322.44
7.0.200.0000.00916.80
7.0.140.0000.06022.08
7.0.60.0070.08020.03
7.0.50.0070.05017.90
7.0.40.0070.08720.15
7.0.30.0230.03720.10
7.0.20.0300.08020.15
7.0.10.0100.08320.17
7.0.00.0130.07720.08
5.6.280.0070.07020.88
5.6.210.0170.06720.65
5.6.200.0030.08718.17
5.6.190.0000.04720.46
5.6.180.0300.03720.68
5.6.170.0370.07020.54
5.6.160.0130.07720.45
5.6.150.0200.07018.14
5.6.140.0070.08318.14
5.6.130.0170.04018.15
5.6.120.0100.08320.93
5.6.110.0000.07021.00
5.6.100.0130.07020.99
5.6.90.0170.04721.15
5.6.80.0070.08020.43
5.5.350.0170.05020.36
5.5.340.0030.08018.09
5.5.330.0070.05720.57
5.5.320.0170.04720.32
5.5.310.0270.06720.24
5.5.300.0100.07317.96
5.5.290.0100.08317.98
5.5.280.0030.05320.92
5.5.270.0070.06020.82
5.5.260.0070.06720.79
5.5.250.0070.03720.74
5.5.240.0030.08020.19
5.4.450.0330.04719.20
5.4.440.0530.06719.48
5.4.430.0470.06719.38
5.4.420.0130.05319.57
5.4.410.0770.05319.57
5.4.400.0730.06019.26
5.4.390.0870.04719.30
5.4.380.0200.05718.73
5.4.370.0270.04718.49
5.4.360.0230.05018.61
5.4.350.0270.05018.83
5.4.340.0130.06018.80
5.4.320.0170.06018.78
5.4.310.0100.06718.59
5.4.300.0230.05018.58
5.4.290.0330.03718.61
5.4.280.0170.07018.82
5.4.270.0330.04318.78
5.4.260.0100.06018.55
5.4.250.0170.05718.77
5.4.240.0230.04718.78
5.4.230.0200.05018.71
5.4.220.0100.06318.55
5.4.210.0170.05318.78
5.4.200.0170.05016.59
5.4.190.0300.04318.74
5.4.180.0200.05018.57
5.4.170.0130.06018.59
5.4.160.0230.04718.58
5.4.150.0230.04718.47
5.4.140.0170.05316.32
5.4.130.0130.05316.29
5.4.120.0200.04716.47
5.4.110.0230.04716.45
5.4.100.0370.04016.35
5.4.90.0170.05716.30
5.4.80.0170.05016.28
5.4.70.0170.05316.32
5.4.60.0130.06316.29
5.4.50.0100.05316.41
5.4.40.0170.05016.29
5.4.30.0170.05316.44
5.4.20.0400.05016.44
5.4.10.0170.05016.41
5.4.00.0230.04715.75
5.3.290.0130.06014.91
5.3.280.0100.06014.72
5.3.270.0200.05014.65
5.3.260.0300.05314.68
5.3.250.0200.05714.73
5.3.240.0230.05014.74
5.3.230.0200.05014.76
5.3.220.0100.06014.59
5.3.210.0100.06314.62
5.3.200.0300.04014.70
5.3.190.0130.05714.59
5.3.180.0230.06714.81
5.3.170.0200.05014.70
5.3.160.0230.05014.72
5.3.150.0170.05314.81
5.3.140.0100.05714.77
5.3.130.0130.05714.68
5.3.120.0370.03714.63
5.3.110.0170.05714.56
5.3.100.0300.04714.20
5.3.90.0330.04014.24
5.3.80.0300.04014.09
5.3.70.0200.04714.07
5.3.60.0170.05014.09
5.3.50.0230.04714.08
5.3.40.0170.06314.03
5.3.30.0200.04713.96
5.3.20.0170.05713.80
5.3.10.0200.04713.70
5.3.00.0230.04713.84
5.2.170.0130.04711.32
5.2.160.0100.04711.23
5.2.150.0130.04311.20
5.2.140.0130.04011.16
5.2.130.0170.03711.23
5.2.120.0100.05011.15
5.2.110.0270.03711.35
5.2.100.0230.04711.15
5.2.90.0230.04011.25
5.2.80.0230.05011.18
5.2.70.0170.04311.14
5.2.60.0270.04011.17
5.2.50.0100.04711.10
5.2.40.0100.04711.12
5.2.30.0200.03311.20
5.2.20.0170.03310.98
5.2.10.0130.03710.90
5.2.00.0200.03010.87
5.1.60.0130.03310.15
5.1.50.0100.03710.05
5.1.40.0170.03010.02
5.1.30.0170.04710.34
5.1.20.0130.03710.46
5.1.10.0100.03710.30
5.1.00.0070.04310.08
5.0.50.0100.0278.61
5.0.40.0070.0278.50
5.0.30.0100.0438.29
5.0.20.0130.0238.45
5.0.10.0070.0308.23
5.0.00.0100.0508.22
4.4.90.0000.0275.91
4.4.80.0130.0175.89
4.4.70.0000.0275.91
4.4.60.0030.0235.98
4.4.50.0000.0276.00
4.4.40.0030.0375.96
4.4.30.0170.0205.88
4.4.20.0030.0235.94
4.4.10.0130.0176.01
4.4.00.0070.0335.91
4.3.110.0000.0275.95
4.3.100.0000.0275.86
4.3.90.0100.0175.84
4.3.80.0000.0405.82
4.3.70.0100.0175.80
4.3.60.0100.0175.86
4.3.50.0100.0205.83
4.3.40.0070.0335.80
4.3.30.0030.0234.68
4.3.20.0000.0274.62
4.3.10.0100.0174.51
4.3.00.0130.0237.37

preferences:
39.27 ms | 401 KiB | 5 Q