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"; $doc = 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.27
8.3.50.0150.00621.92
8.3.40.0090.00918.67
8.3.30.0030.01018.88
8.3.20.0040.00420.26
8.3.10.0040.00423.48
8.3.00.0080.00319.02
8.2.180.0040.01818.66
8.2.170.0110.00422.96
8.2.160.0100.00322.08
8.2.150.0120.00424.18
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0000.00819.54
8.2.110.0090.00022.17
8.2.100.0060.00617.91
8.2.90.0080.00019.47
8.2.80.0050.00318.73
8.2.70.0030.00617.50
8.2.60.0030.00618.04
8.2.50.0060.00318.07
8.2.40.0030.00518.15
8.2.30.0070.00018.02
8.2.20.0030.00617.70
8.2.10.0000.00818.14
8.2.00.0000.00717.77
8.1.280.0100.00725.92
8.1.270.0040.00419.08
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0060.00323.73
8.1.230.0080.00419.01
8.1.220.0030.00617.74
8.1.210.0030.00518.77
8.1.200.0030.00617.22
8.1.190.0050.00317.10
8.1.180.0080.00018.10
8.1.170.0030.00518.71
8.1.160.0040.00418.75
8.1.150.0000.00718.89
8.1.140.0040.00417.48
8.1.130.0030.00317.86
8.1.120.0040.00417.39
8.1.110.0000.00817.39
8.1.100.0040.00417.46
8.1.90.0050.00217.47
8.1.80.0070.00017.30
8.1.70.0030.00317.49
8.1.60.0000.00817.68
8.1.50.0040.00417.52
8.1.40.0040.00417.61
8.1.30.0000.00817.66
8.1.20.0070.00017.74
8.1.10.0040.00417.64
8.1.00.0000.00817.51
8.0.300.0090.00018.77
8.0.290.0030.00616.88
8.0.280.0000.00818.49
8.0.270.0030.00317.18
8.0.260.0100.00017.25
8.0.250.0030.00317.09
8.0.240.0000.00717.02
8.0.230.0040.00416.96
8.0.220.0000.00716.94
8.0.210.0000.00716.89
8.0.200.0000.01016.98
8.0.190.0040.00417.00
8.0.180.0050.00316.92
8.0.170.0000.00716.91
8.0.160.0060.00317.01
8.0.150.0000.00816.86
8.0.140.0050.00216.87
8.0.130.0000.00613.38
8.0.120.0060.00316.86
8.0.110.0000.00816.89
8.0.100.0000.00716.89
8.0.90.0040.00416.83
8.0.80.0130.00317.03
8.0.70.0070.00017.01
8.0.60.0030.00516.76
8.0.50.0000.00716.93
8.0.30.0110.00817.28
8.0.20.0130.00817.45
8.0.10.0000.00716.89
8.0.00.0100.01116.69
7.4.330.0000.00515.03
7.4.320.0030.00316.48
7.4.300.0040.00416.66
7.4.290.0030.00316.68
7.4.280.0080.00016.53
7.4.270.0040.00416.62
7.4.260.0000.00716.54
7.4.250.0040.00416.49
7.4.240.0050.00316.69
7.4.230.0030.00316.31
7.4.220.0170.01016.72
7.4.210.0070.01316.61
7.4.200.0040.00416.71
7.4.160.0040.01116.74
7.4.150.0100.01217.40
7.4.140.0090.00817.86
7.4.130.0120.00616.60
7.4.120.0100.00916.63
7.4.110.0120.01216.52
7.4.100.0050.00416.52
7.4.90.0170.00016.62
7.4.80.0070.01619.39
7.4.70.0100.00716.64
7.4.60.0090.00916.69
7.4.50.0050.00016.68
7.4.40.0070.01416.52
7.4.30.0140.00316.60
7.4.00.0070.01215.15
7.3.330.0000.00613.29
7.3.320.0000.00613.31
7.3.310.0030.00316.42
7.3.300.0040.00416.33
7.3.290.0040.00916.36
7.3.280.0110.00916.33
7.3.270.0100.00617.40
7.3.260.0070.01016.46
7.3.250.0150.00316.34
7.3.240.0070.01016.66
7.3.230.0140.00316.52
7.3.210.0120.00616.46
7.3.200.0110.00619.39
7.3.190.0070.01016.41
7.3.180.0110.00416.44
7.3.170.0100.00716.48
7.3.160.0090.00916.55
7.3.120.0090.00914.97
7.3.110.0060.01014.84
7.3.100.0070.01014.97
7.3.90.0140.00014.88
7.3.80.0090.00614.76
7.3.70.0060.00914.74
7.3.60.0090.00314.80
7.3.50.0070.00714.46
7.3.40.0110.00414.85
7.3.30.0130.00014.87
7.3.20.0120.00316.32
7.3.10.0070.00316.60
7.3.00.0060.00716.38
7.2.330.0110.00816.91
7.2.320.0100.01316.33
7.2.310.0100.01416.69
7.2.300.0110.00916.75
7.2.290.0100.01016.42
7.2.250.0060.01314.86
7.2.240.0030.01314.80
7.2.230.0030.01014.54
7.2.220.0090.00615.15
7.2.210.0060.01014.97
7.2.200.0000.01215.00
7.2.190.0000.01814.89
7.2.180.0000.01714.94
7.2.170.0000.01015.03
7.2.130.0130.00316.81
7.2.120.0080.00516.55
7.2.110.0100.00316.73
7.2.100.0100.00616.45
7.2.90.0070.00216.75
7.2.80.0100.00516.64
7.2.70.0140.00716.55
7.2.60.0150.00316.66
7.2.50.0080.00516.69
7.2.40.0160.00316.46
7.2.30.0090.00916.84
7.2.20.0100.00716.72
7.2.10.0160.00016.68
7.2.00.0080.00718.02
7.1.330.0060.00915.52
7.1.320.0040.01115.81
7.1.310.0080.00815.59
7.1.300.0080.00415.55
7.1.290.0060.00615.43
7.1.280.0030.00815.42
7.1.270.0040.01215.61
7.1.260.0000.01315.41
7.1.250.0040.00715.36
7.1.200.0090.00615.25
7.1.100.0030.00717.62
7.1.70.0040.00416.75
7.1.60.0070.01819.22
7.1.50.0100.02334.79
7.1.00.0030.07722.40
7.0.200.0040.00416.87
7.0.140.0030.06021.97
7.0.60.0170.04020.09
7.0.50.0030.08717.91
7.0.40.0070.06720.11
7.0.30.0270.03320.30
7.0.20.0330.07020.21
7.0.10.0070.05020.11
7.0.00.0000.07720.06
5.6.280.0000.07321.07
5.6.210.0100.04720.51
5.6.200.0130.07718.19
5.6.190.0130.05020.48
5.6.180.0200.04320.61
5.6.170.0200.04720.57
5.6.160.0130.07020.62
5.6.150.0070.08018.29
5.6.140.0030.04318.27
5.6.130.0030.05318.28
5.6.120.0030.08721.19
5.6.110.0100.08021.04
5.6.100.0070.06021.07
5.6.90.0100.08321.07
5.6.80.0130.07320.42
5.5.350.0170.07320.34
5.5.340.0000.04318.04
5.5.330.0070.04720.57
5.5.320.0270.03720.30
5.5.310.0330.06020.19
5.5.300.0000.04718.07
5.5.290.0070.07318.01
5.5.280.0030.05720.85
5.5.270.0070.08320.93
5.5.260.0030.09020.93
5.5.250.0000.04320.63
5.5.240.0030.05320.09
5.4.450.0200.06019.45
5.4.440.0570.06019.47
5.4.430.0100.05319.63
5.4.420.0000.06719.46
5.4.410.0300.06019.26
5.4.400.0770.06018.84
5.4.390.0670.06719.13
5.4.380.0200.05718.74
5.4.370.0200.05318.79
5.4.360.0200.05318.80
5.4.350.0230.06018.81
5.4.340.0170.05318.71
5.4.320.0100.06318.60
5.4.310.0100.06018.78
5.4.300.0200.05318.55
5.4.290.0100.06018.63
5.4.280.0230.04718.63
5.4.270.0200.05018.82
5.4.260.0130.06018.75
5.4.250.0130.06018.79
5.4.240.0230.05018.63
5.4.230.0270.04318.75
5.4.220.0200.05318.77
5.4.210.0170.05318.62
5.4.200.0130.05316.57
5.4.190.0170.05318.50
5.4.180.0170.05318.62
5.4.170.0200.06318.56
5.4.160.0170.05718.78
5.4.150.0130.06018.52
5.4.140.0170.05316.28
5.4.130.0270.04316.33
5.4.120.0300.03716.48
5.4.110.0130.05316.23
5.4.100.0130.06016.27
5.4.90.0130.06016.33
5.4.80.0070.06316.26
5.4.70.0170.05716.28
5.4.60.0270.04316.24
5.4.50.0200.04716.29
5.4.40.0170.05316.25
5.4.30.0400.04716.29
5.4.20.0130.07716.18
5.4.10.0270.06016.24
5.4.00.0130.07315.80
5.3.290.0170.05714.76
5.3.280.0130.06014.80
5.3.270.0170.05314.68
5.3.260.0130.05714.79
5.3.250.0030.06314.67
5.3.240.0230.04714.79
5.3.230.0200.05014.83
5.3.220.0230.04714.75
5.3.210.0200.05314.61
5.3.200.0230.04314.66
5.3.190.0200.05014.63
5.3.180.0170.05314.79
5.3.170.0270.05314.64
5.3.160.0170.05014.64
5.3.150.0200.05014.66
5.3.140.0170.06714.60
5.3.130.0200.06314.64
5.3.120.0200.05714.65
5.3.110.0170.05014.81
5.3.100.0130.05314.27
5.3.90.0070.06314.17
5.3.80.0070.06314.18
5.3.70.0230.04314.23
5.3.60.0170.05314.10
5.3.50.0100.05714.05
5.3.40.0100.06314.02
5.3.30.0100.05314.02
5.3.20.0230.05013.90
5.3.10.0200.04713.68
5.3.00.0130.05013.81
5.2.170.0170.03711.30
5.2.160.0100.04011.19
5.2.150.0100.04311.41
5.2.140.0130.04011.23
5.2.130.0130.04311.13
5.2.120.0170.04711.25
5.2.110.0130.04011.25
5.2.100.0130.05011.17
5.2.90.0170.03711.18
5.2.80.0170.03711.27
5.2.70.0130.04311.26
5.2.60.0200.03711.25
5.2.50.0030.05011.12
5.2.40.0170.03711.05
5.2.30.0100.04311.01
5.2.20.0100.04011.07
5.2.10.0170.03710.93
5.2.00.0070.04710.82
5.1.60.0130.04310.06
5.1.50.0100.03710.23
5.1.40.0130.03310.01
5.1.30.0170.03010.43
5.1.20.0130.04010.43
5.1.10.0230.04010.30
5.1.00.0230.04010.32
5.0.50.0100.0408.62
5.0.40.0100.0378.60
5.0.30.0100.0538.30
5.0.20.0030.0408.28
5.0.10.0130.0338.30
5.0.00.0130.0378.32
4.4.90.0100.0175.89
4.4.80.0100.0175.86
4.4.70.0000.0276.00
4.4.60.0030.0235.92
4.4.50.0030.0236.01
4.4.40.0030.0375.88
4.4.30.0070.0205.92
4.4.20.0030.0305.95
4.4.10.0070.0276.07
4.4.00.0100.0305.91
4.3.110.0070.0205.88
4.3.100.0070.0205.84
4.3.90.0100.0175.79
4.3.80.0000.0375.79
4.3.70.0030.0235.79
4.3.60.0070.0205.81
4.3.50.0070.0205.82
4.3.40.0070.0335.76
4.3.30.0000.0274.64
4.3.20.0070.0234.64
4.3.10.0000.0234.59
4.3.00.0000.0237.37

preferences:
38.02 ms | 401 KiB | 5 Q