3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyText extends DOMText { public $id; public static $next = 0; function __construct($text) { parent::__construct($text); $this->id = MyText::$next++; echo "Constructing DOMText #" . $this->id . ": " . $this->wholeText . "\n"; } function __destruct() { echo "Destructing DOMText #" . $this->id . ": " . $this->wholeText . "\n"; } } class MyElement extends DOMElement { public $id; public static $next = 0; function __construct($name) { parent::__construct($name); $this->id = MyText::$next++; echo "Constructing DOMElement #" . $this->id . ": " . $this->tagName . "\n"; } 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('DOMText', 'MyText'); $dom->registerNodeClass('DOMElement', 'MyElement'); $dom->appendChild($dom->createElement('foo')); $dom->appendChild($dom->createElement('bar')); echo "Leave foo()\n"; return $dom; } function bar() { echo "Enter bar()\n"; $d = 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.0090.00918.38
8.3.50.0130.00922.03
8.3.40.0120.00318.84
8.3.30.0070.00719.01
8.3.20.0040.00420.16
8.3.10.0080.00023.51
8.3.00.0060.00619.12
8.2.180.0160.00618.41
8.2.170.0100.00322.96
8.2.160.0100.00322.29
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00419.67
8.2.110.0070.01319.27
8.2.100.0080.00418.03
8.2.90.0000.00817.63
8.2.80.0040.00717.97
8.2.70.0000.00818.03
8.2.60.0050.00318.22
8.2.50.0040.00418.10
8.2.40.0030.00519.42
8.2.30.0000.00719.35
8.2.20.0000.00717.55
8.2.10.0070.00018.16
8.2.00.0080.00017.66
8.1.280.0000.01925.92
8.1.270.0030.00518.87
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0030.00522.14
8.1.230.0040.00719.03
8.1.220.0000.00817.74
8.1.210.0000.00918.77
8.1.200.0030.00617.36
8.1.190.0040.00417.23
8.1.180.0000.00818.10
8.1.170.0040.00418.84
8.1.160.0050.00219.05
8.1.150.0050.00319.00
8.1.140.0000.00717.61
8.1.130.0050.00518.00
8.1.120.0000.00717.55
8.1.110.0080.00017.48
8.1.100.0030.00517.54
8.1.90.0070.00017.54
8.1.80.0050.00217.54
8.1.70.0000.00717.46
8.1.60.0040.00417.67
8.1.50.0030.00617.55
8.1.40.0000.00817.57
8.1.30.0000.00717.63
8.1.20.0040.00417.65
8.1.10.0000.00817.66
8.1.00.0040.00417.57
8.0.300.0070.00020.29
8.0.290.0060.00316.58
8.0.280.0030.00518.43
8.0.270.0080.00017.21
8.0.260.0000.00817.21
8.0.250.0030.00316.95
8.0.240.0040.00417.08
8.0.230.0000.00717.05
8.0.220.0000.00716.98
8.0.210.0040.00416.97
8.0.200.0060.00316.96
8.0.190.0040.00416.93
8.0.180.0040.00417.04
8.0.170.0040.00416.96
8.0.160.0030.00516.92
8.0.150.0000.00716.96
8.0.140.0070.00016.88
8.0.130.0040.00413.37
8.0.120.0040.00416.85
8.0.110.0070.00016.83
8.0.100.0040.00416.80
8.0.90.0070.00017.04
8.0.80.0060.00916.99
8.0.70.0020.00517.11
8.0.60.0040.00416.93
8.0.50.0070.00016.83
8.0.30.0100.00917.24
8.0.20.0100.00917.40
8.0.10.0000.00817.01
8.0.00.0080.01416.92
7.4.330.0020.00215.18
7.4.320.0060.00016.48
7.4.300.0000.00616.59
7.4.290.0000.00716.66
7.4.280.0050.00316.61
7.4.270.0000.00716.71
7.4.260.0030.00316.46
7.4.250.0000.00716.60
7.4.240.0050.00216.56
7.4.230.0000.00716.38
7.4.220.0070.02116.52
7.4.210.0070.01116.82
7.4.200.0040.00416.43
7.4.160.0030.01316.74
7.4.150.0040.01417.40
7.4.140.0100.00817.86
7.4.130.0080.01216.46
7.4.120.0160.00316.53
7.4.110.0150.01116.61
7.4.100.0100.01016.52
7.4.90.0090.00916.62
7.4.80.0080.01319.39
7.4.70.0030.01316.56
7.4.60.0000.01716.48
7.4.50.0000.00616.36
7.4.40.0030.01416.48
7.4.30.0140.00316.64
7.4.00.0090.00715.04
7.3.330.0020.00213.30
7.3.320.0030.00313.29
7.3.310.0000.00716.39
7.3.300.0060.00016.16
7.3.290.0040.01116.34
7.3.280.0060.01216.33
7.3.270.0070.01017.40
7.3.260.0100.00916.38
7.3.250.0070.01116.54
7.3.240.0060.01216.48
7.3.230.0060.01316.70
7.3.210.0090.01516.38
7.3.200.0060.01619.39
7.3.190.0070.01016.49
7.3.180.0080.00816.39
7.3.170.0070.01016.43
7.3.160.0130.00416.65
7.3.120.0030.01414.83
7.3.110.0040.01514.85
7.3.100.0060.01214.76
7.3.90.0070.01015.00
7.3.80.0040.01414.74
7.3.70.0090.00914.66
7.3.60.0030.01014.89
7.3.50.0060.00614.52
7.3.40.0090.00614.71
7.3.30.0030.00614.68
7.3.20.0070.00716.65
7.3.10.0070.00716.69
7.3.00.0130.00316.45
7.2.330.0150.00316.68
7.2.320.0130.00616.75
7.2.310.0150.00916.49
7.2.300.0110.01116.80
7.2.290.0170.00816.79
7.2.250.0100.01015.08
7.2.240.0140.00715.02
7.2.230.0100.00315.04
7.2.220.0070.01115.21
7.2.210.0120.00615.08
7.2.200.0080.00515.21
7.2.190.0070.01015.03
7.2.180.0000.01914.99
7.2.170.0110.00415.18
7.2.160.0070.00715.00
7.2.150.0040.01116.93
7.2.140.0040.01216.65
7.2.130.0030.01016.95
7.2.120.0030.01016.96
7.2.110.0080.00516.95
7.2.100.0080.00916.87
7.2.90.0030.01116.93
7.2.80.0080.00416.50
7.2.70.0030.00916.97
7.2.60.0060.00917.05
7.2.50.0060.00916.84
7.2.40.0040.01216.87
7.2.30.0070.00717.01
7.2.20.0060.00617.05
7.2.10.0070.01116.92
7.2.00.0060.00618.24
7.1.330.0120.00615.78
7.1.320.0070.01015.76
7.1.310.0090.00615.81
7.1.300.0030.01215.73
7.1.290.0090.00915.63
7.1.280.0070.00715.48
7.1.270.0050.00515.35
7.1.260.0000.01715.56
7.1.250.0070.00715.72
7.1.240.0040.00815.74
7.1.230.0100.00315.82
7.1.220.0070.01015.49
7.1.210.0070.01015.84
7.1.200.0040.00715.63
7.1.190.0040.00415.48
7.1.180.0070.00315.65
7.1.170.0060.00915.82
7.1.160.0060.00915.84
7.1.150.0030.00715.71
7.1.140.0080.00715.77
7.1.130.0100.00715.48
7.1.120.0110.00615.79
7.1.110.0070.00715.84
7.1.100.0080.00416.83
7.1.90.0040.01115.76
7.1.80.0030.00715.80
7.1.70.0030.00716.42
7.1.60.0060.01217.39
7.1.50.0030.01216.13
7.1.40.0100.00315.72
7.1.30.0060.00815.62
7.1.20.0060.00915.81
7.1.10.0000.01015.72
7.1.00.0050.04319.00
7.0.330.0080.00815.18
7.0.320.0030.01415.41
7.0.310.0100.00315.38
7.0.300.0030.01015.12
7.0.290.0030.01215.30
7.0.280.0040.00815.46
7.0.270.0070.00715.16
7.0.260.0050.00515.44
7.0.250.0070.00715.46
7.0.240.0040.00415.23
7.0.230.0070.01015.41
7.0.220.0030.01015.39
7.0.210.0070.00715.53
7.0.200.0060.00816.11
7.0.190.0000.01115.36
7.0.180.0060.00615.46
7.0.170.0080.00615.15
7.0.160.0040.00415.21
7.0.150.0060.00615.35
7.0.140.0030.03818.61
7.0.130.0130.00015.50
7.0.120.0060.00315.40
7.0.110.0080.00414.98
7.0.100.0040.00915.50
7.0.90.0000.01015.27
7.0.80.0000.01515.51
7.0.70.0090.00315.42
7.0.60.0070.04517.52
7.0.50.0130.01816.65
7.0.40.0060.05016.92
7.0.30.0120.04316.73
7.0.20.0200.04316.81
7.0.10.0030.02716.85
7.0.00.0100.04116.60
5.6.400.0040.00814.54
5.6.390.0040.00814.53
5.6.380.0070.00314.37
5.6.370.0090.00014.70
5.6.360.0000.01014.13
5.6.350.0110.00314.42
5.6.340.0000.01314.38
5.6.330.0060.00914.44
5.6.320.0000.01314.28
5.6.310.0060.00614.42
5.6.300.0090.00614.64
5.6.290.0000.01414.34
5.6.280.0020.04317.65
5.6.270.0070.00714.35
5.6.260.0080.00314.14
5.6.250.0040.00714.27
5.6.240.0040.01114.27
5.6.230.0030.01214.23
5.6.220.0030.01014.07
5.6.210.0070.03917.46
5.6.200.0050.04916.28
5.6.190.0140.04217.34
5.6.180.0140.04417.40
5.6.170.0170.02217.39
5.6.160.0100.03217.36
5.6.150.0050.02016.25
5.6.140.0000.03116.26
5.6.130.0080.03616.33
5.6.120.0050.02517.66
5.6.110.0090.02217.51
5.6.100.0120.04017.66
5.6.90.0150.03317.61
5.6.80.0140.03517.45
5.6.70.0260.02717.31
5.6.60.0060.00614.12
5.6.50.0100.00314.06
5.6.40.0070.01014.05
5.6.30.0030.01014.34
5.6.20.0030.01314.14
5.6.10.0100.00314.19
5.6.00.0030.00614.02
5.5.380.0000.01614.32
5.5.370.0000.01314.12
5.5.360.0070.00714.25
5.5.350.0050.03917.41
5.5.340.0080.02016.10
5.5.330.0070.03017.37
5.5.320.0160.04517.34
5.5.310.0210.02517.29
5.5.300.0020.02716.08
5.5.290.0060.02616.20
5.5.280.0030.04717.63
5.5.270.0050.02517.54
5.5.260.0040.02617.52
5.5.250.0030.03017.46
5.5.240.0120.03717.21
5.5.230.0030.00614.10
5.5.220.0070.00314.31
5.5.210.0000.00913.98
5.5.200.0000.01514.12
5.5.190.0070.00314.05
5.5.180.0000.00914.09
5.5.170.0040.00814.38
5.5.160.0030.00614.17
5.5.150.0070.00414.15
5.5.140.0080.00414.17
5.5.130.0110.00413.93
5.5.120.0000.01514.45
5.5.110.0000.01414.04
5.5.100.0090.00613.99
5.5.90.0090.00314.04
5.5.80.0030.01014.61
5.5.70.0040.01114.09
5.5.60.0030.00814.52
5.5.50.0070.00714.25
5.5.40.0000.01414.19
5.5.30.0090.00614.33
5.5.20.0120.00314.35
5.5.10.0140.00314.42
5.5.00.0000.00913.97
5.4.450.0100.03315.38
5.4.440.0120.03215.29
5.4.430.0060.03315.48
5.4.420.0480.03815.38
5.4.410.0330.03315.34
5.4.400.0060.03515.03
5.4.390.0060.03615.18
5.4.380.0070.03314.95
5.4.370.0100.03214.77
5.4.360.0150.02714.79
5.4.350.0110.03014.79
5.4.340.0070.03515.05
5.4.330.0000.01311.18
5.4.320.0150.02814.88
5.4.310.0080.03514.92
5.4.300.0200.02015.03
5.4.290.0080.03015.03
5.4.280.0130.02914.93
5.4.270.0130.02714.81
5.4.260.0100.03414.83
5.4.250.0130.03014.72
5.4.240.0080.03515.03
5.4.230.0110.02814.88
5.4.220.0130.02814.76
5.4.210.0150.02515.02
5.4.200.0080.03313.67
5.4.190.0150.02614.81
5.4.180.0120.02914.82
5.4.170.0100.03114.76
5.4.160.0150.02514.93
5.4.150.0110.02714.79
5.4.140.0100.02713.74
5.4.130.0060.02913.68
5.4.120.0100.02513.74
5.4.110.0100.02813.82
5.4.100.0110.02813.76
5.4.90.0120.02913.69
5.4.80.0060.03313.77
5.4.70.0180.02313.79
5.4.60.0090.03113.72
5.4.50.0130.02313.77
5.4.40.0130.02513.54
5.4.30.0100.03113.74
5.4.20.0120.02813.67
5.4.10.0050.03213.50
5.4.00.0070.03013.35
5.3.290.0130.05714.83
5.3.280.0200.04714.68
5.3.270.0200.05014.88
5.3.260.0170.05714.71
5.3.250.0170.05314.67
5.3.240.0100.06714.83
5.3.230.0270.04314.77
5.3.220.0230.04314.74
5.3.210.0130.06014.74
5.3.200.0200.05014.85
5.3.190.0200.05714.68
5.3.180.0130.05714.82
5.3.170.0200.05014.74
5.3.160.0200.04714.59
5.3.150.0130.06014.59
5.3.140.0170.05314.77
5.3.130.0200.05014.57
5.3.120.0200.05014.80
5.3.110.0270.04714.63
5.3.100.0170.05314.29
5.3.90.0130.05714.16
5.3.80.0300.04314.11
5.3.70.0170.05714.09
5.3.60.0200.05014.25
5.3.50.0130.05314.16
5.3.40.0230.05314.04
5.3.30.0300.03714.00
5.3.20.0200.04713.84
5.3.10.0130.05713.81
5.3.00.0200.07013.70
5.2.170.0070.05011.19
5.2.160.0300.04311.18
5.2.150.0300.04311.41
5.2.140.0270.04311.21
5.2.130.0170.05711.19
5.2.120.0100.05311.25
5.2.110.0100.04311.18
5.2.100.0070.04711.20
5.2.90.0130.04011.37
5.2.80.0170.04011.14
5.2.70.0100.04311.25
5.2.60.0130.04311.14
5.2.50.0200.03711.09
5.2.40.0130.03711.15
5.2.30.0230.04011.05
5.2.20.0030.05011.04
5.2.10.0130.03711.01
5.2.00.0130.03710.80
5.1.60.0070.03710.03
5.1.50.0130.03010.16
5.1.40.0070.03710.05
5.1.30.0100.03710.40
5.1.20.0070.04710.46
5.1.10.0130.03710.30
5.1.00.0170.04310.16
5.0.50.0070.0308.71
5.0.40.0030.0308.61
5.0.30.0130.0538.30
5.0.20.0230.0238.27
5.0.10.0070.0308.30
5.0.00.0070.0578.39
4.4.90.0130.0235.96
4.4.80.0030.0235.91
4.4.70.0030.0235.91
4.4.60.0070.0205.91
4.4.50.0070.0205.88
4.4.40.0070.0335.93
4.4.30.0000.0275.98
4.4.20.0030.0235.98
4.4.10.0030.0235.99
4.4.00.0070.0335.92
4.3.110.0030.0235.85
4.3.100.0070.0205.82
4.3.90.0000.0275.85
4.3.80.0130.0275.82
4.3.70.0070.0205.80
4.3.60.0030.0235.79
4.3.50.0030.0235.88
4.3.40.0100.0405.86
4.3.30.0030.0234.58
4.3.20.0070.0204.61
4.3.10.0000.0234.48
4.3.00.0070.0237.37

preferences:
69.82 ms | 401 KiB | 5 Q