3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<EOL <document> <test> <foo>2</foo> <bar>hello</bar> </test> <test> <foo>5</foo> <bar attr="value">bye</bar> </test> </document> EOL; libxml_use_internal_errors(true); $dom = new DomDocument; $dom->recover = true; if(!$dom->loadXML($xml)) die('Error happened'); $nodesTest = $dom->getElementsByTagName('test'); $res = array(); foreach($nodesTest as $test) { $foo = $test->getElementsByTagName('foo'); $bar = $test->getElementsByTagName('bar'); if($foo->length === 1 && $bar->length === 1) { $x = array($bar->item(0)->nodeValue); if($bar->item(0)->hasAttribute('attr')) $x[] = $bar->item(0)->getAttribute('attr'); $res[$foo->item(0)->nodeValue] = $x; } } var_dump($res);

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.70.0000.01416.75
8.3.60.0120.00918.68
8.3.50.0110.00922.21
8.3.40.0120.00319.27
8.3.30.0090.00918.81
8.3.20.0140.00020.23
8.3.10.0000.00822.16
8.3.00.0060.00319.75
8.2.190.0150.00017.00
8.2.180.0120.00918.66
8.2.170.0130.00322.96
8.2.160.0030.01019.70
8.2.150.0060.00324.18
8.2.140.0120.00624.66
8.2.130.0050.00222.46
8.2.120.0080.00026.35
8.2.110.0030.00619.43
8.2.100.0090.00318.16
8.2.90.0000.00819.42
8.2.80.0080.00017.97
8.2.70.0040.00417.75
8.2.60.0080.00318.05
8.2.50.0040.00418.07
8.2.40.0050.00318.47
8.2.30.0080.00018.38
8.2.20.0000.00817.95
8.2.10.0040.00418.33
8.2.00.0030.00618.42
8.1.280.0110.01125.92
8.1.270.0140.00424.04
8.1.260.0090.00028.09
8.1.250.0050.00328.09
8.1.240.0080.00024.16
8.1.230.0040.00717.77
8.1.220.0080.00018.01
8.1.210.0050.00518.77
8.1.200.0100.00017.61
8.1.190.0000.00917.48
8.1.180.0030.00718.10
8.1.170.0040.00418.84
8.1.160.0040.00419.09
8.1.150.0040.00420.91
8.1.140.0050.00319.86
8.1.130.0050.00317.89
8.1.120.0030.00517.57
8.1.110.0000.00817.73
8.1.100.0070.00017.61
8.1.90.0050.00317.77
8.1.80.0040.00417.76
8.1.70.0040.00417.72
8.1.60.0040.00417.75
8.1.50.0000.00917.82
8.1.40.0040.00717.69
8.1.30.0040.00417.77
8.1.20.0000.00917.77
8.1.10.0040.00417.84
8.1.00.0020.00517.75
8.0.300.0040.00418.77
8.0.290.0000.00817.00
8.0.280.0060.00318.57
8.0.270.0070.00017.40
8.0.260.0030.00317.49
8.0.250.0030.00317.17
8.0.240.0040.00417.30
8.0.230.0030.00317.20
8.0.220.0000.00817.23
8.0.210.0060.00317.07
8.0.200.0000.00717.13
8.0.190.0000.00717.14
8.0.180.0040.00417.15
8.0.170.0040.00417.18
8.0.160.0030.00517.24
8.0.150.0000.00717.17
8.0.140.0040.00417.18
8.0.130.0080.00013.54
8.0.120.0000.00817.18
8.0.110.0040.00417.24
8.0.100.0000.00817.23
8.0.90.0030.00517.21
8.0.80.0080.00817.21
8.0.70.0090.00017.06
8.0.60.0050.00317.03
8.0.50.0070.00017.09
8.0.30.0110.00717.14
8.0.20.0120.00717.50
8.0.10.0040.00417.40
8.0.00.0030.01316.78
7.4.330.0000.00515.39
7.4.320.0000.00616.71
7.4.300.0000.00716.73
7.4.290.0030.00316.75
7.4.280.0040.00416.72
7.4.270.0070.00016.71
7.4.260.0030.00316.79
7.4.250.0070.00016.89
7.4.240.0020.00516.80
7.4.230.0070.00016.93
7.4.220.0100.00716.67
7.4.210.0090.01216.84
7.4.200.0040.00416.88
7.4.160.0100.00716.79
7.4.150.0150.01117.40
7.4.140.0140.00317.86
7.4.130.0110.01116.71
7.4.120.0080.00916.76
7.4.110.0120.00616.79
7.4.100.0040.01816.66
7.4.90.0060.01416.72
7.4.80.0100.01519.39
7.4.70.0070.01016.59
7.4.60.0060.01616.64
7.4.50.0130.00316.78
7.4.40.0100.01016.83
7.4.30.0100.01016.82
7.4.00.0130.00014.76
7.3.330.0040.00413.54
7.3.320.0030.00313.48
7.3.310.0030.00316.66
7.3.300.0060.00016.59
7.3.290.0100.00716.63
7.3.280.0080.00916.61
7.3.270.0140.00317.40
7.3.260.0130.00816.77
7.3.250.0090.00916.70
7.3.240.0070.01216.72
7.3.230.0070.01016.76
7.3.210.0030.01316.75
7.3.200.0030.01416.70
7.3.190.0090.01216.75
7.3.180.0090.01316.70
7.3.170.0100.00716.68
7.3.160.0190.00316.70
7.2.330.0030.01516.66
7.2.320.0030.01316.75
7.2.310.0090.00916.65
7.2.300.0100.00816.82
7.2.290.0100.00716.69
7.2.60.0070.01016.79
7.2.00.0070.00719.50
7.1.200.0030.01016.11
7.1.70.0000.01017.13
7.1.60.0000.01119.45
7.1.00.0000.08022.58
7.0.200.0000.00817.02
7.0.80.0230.06019.96
7.0.70.0270.05319.96
7.0.60.0230.06019.96
7.0.50.0170.07020.50
7.0.40.0270.05720.39
7.0.30.0200.06320.55
7.0.20.0270.06020.50
7.0.10.0230.07020.27
7.0.00.0300.06020.35
5.6.230.0270.04720.96
5.6.220.0130.05320.93
5.6.210.0200.05320.71
5.6.200.0070.06721.12
5.6.190.0130.05721.30
5.6.180.0230.05021.29
5.6.170.0130.05721.17
5.6.160.0100.06021.23
5.6.150.0130.06021.12
5.6.140.0170.05321.23
5.6.130.0100.06321.25
5.6.120.0200.05321.14
5.6.110.0100.06321.27
5.6.100.0100.06021.26
5.6.90.0130.06021.17
5.6.80.0130.06020.64
5.6.70.0100.05720.57
5.6.60.0030.06320.59
5.6.50.0170.05020.51
5.6.40.0070.06320.56
5.6.30.0230.06020.53
5.6.20.0230.06020.48
5.6.10.0100.06020.54
5.6.00.0070.06720.53

preferences:
67.94 ms | 401 KiB | 5 Q