3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str='<root> <book id="1"> <title>..1.</title> <author>.1..</author> </book> <book id="2"> <title>.2..</title> <author>.2..</author> </book> <book id="3"> <title>.3..</title> <author>.3..</author> </book> </root>'; $dom = new DOMDocument; $dom->loadXML($str); $xpath = new DOMXPath($dom); $book = $xpath->query("//book[@id='2']")->item(0); //$html = ""; foreach($book->childNodes as $node) { @$html .= $dom->saveHTML($node); } echo $html; ?>

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.0160.00617.13
8.3.50.0130.01016.66
8.3.40.0060.00919.11
8.3.30.0070.00719.17
8.3.20.0050.00320.90
8.3.10.0040.00422.10
8.3.00.0050.00323.79
8.2.180.0150.00016.88
8.2.170.0150.00022.96
8.2.160.0110.00322.62
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00420.33
8.2.120.0030.00526.35
8.2.110.0100.00019.55
8.2.100.0120.00318.28
8.2.90.0080.00019.59
8.2.80.0000.00818.00
8.2.70.0060.00318.00
8.2.60.0050.00318.42
8.2.50.0030.00619.66
8.2.40.0030.00520.92
8.2.30.0030.00619.61
8.2.20.0070.00018.45
8.2.10.0020.00518.43
8.2.00.0040.00418.31
8.1.270.0040.00422.56
8.1.260.0070.00028.09
8.1.250.0050.00328.09
8.1.240.0090.00021.44
8.1.230.0000.01219.40
8.1.220.0000.00818.16
8.1.210.0040.00418.77
8.1.200.0060.00317.60
8.1.190.0030.00617.36
8.1.180.0030.00618.10
8.1.170.0000.00918.87
8.1.160.0040.00422.48
8.1.150.0040.00422.34
8.1.140.0000.00717.84
8.1.130.0030.00518.03
8.1.120.0040.00417.90
8.1.110.0080.00317.82
8.1.100.0040.00417.83
8.1.90.0000.00717.68
8.1.80.0050.00317.69
8.1.70.0060.00317.91
8.1.60.0000.00917.93
8.1.50.0040.00417.83
8.1.40.0060.00317.79
8.1.30.0030.00617.94
8.1.20.0040.00417.96
8.1.10.0050.00317.95
8.1.00.0040.00417.91
8.0.300.0040.00420.46
8.0.290.0050.00316.98
8.0.280.0000.00718.81
8.0.270.0000.00817.16
8.0.260.0030.00317.54
8.0.250.0030.00317.29
8.0.240.0070.00017.23
8.0.230.0000.00717.34
8.0.220.0000.00717.20
8.0.210.0020.00517.35
8.0.200.0080.00017.27
8.0.190.0000.00717.28
8.0.180.0000.00717.18
8.0.170.0000.00717.31
8.0.160.0000.00717.20
8.0.150.0080.00017.26
8.0.140.0040.00417.11
8.0.130.0060.00013.64
8.0.120.0000.00817.29
8.0.110.0070.00017.32
8.0.100.0000.00817.32
8.0.90.0000.00817.17
8.0.80.0100.00717.36
8.0.70.0000.00717.28
8.0.60.0040.00417.20
8.0.50.0000.00817.27
8.0.30.0110.00817.29
8.0.20.0120.00917.47
8.0.10.0000.00717.29
8.0.00.0090.00917.15
7.4.330.0000.00815.55
7.4.320.0000.00916.98
7.4.300.0060.00016.78
7.4.290.0050.00216.89
7.4.280.0070.00416.92
7.4.270.0030.00616.86
7.4.260.0030.00616.77
7.4.250.0080.00016.94
7.4.240.0000.00716.99
7.4.230.0000.00816.70
7.4.220.0060.01416.78
7.4.210.0140.00716.97
7.4.200.0040.00416.70
7.4.160.0090.00916.76
7.4.150.0120.00617.40
7.4.140.0080.01017.86
7.4.130.0120.00616.85
7.4.120.0060.01216.83
7.4.110.0080.00816.88
7.4.100.0060.01016.86
7.4.90.0090.00917.02
7.4.80.0070.01419.39
7.4.70.0110.00616.84
7.4.60.0130.00316.73
7.4.50.0100.00716.96
7.4.40.0120.00416.63
7.4.30.0030.01416.88
7.4.10.0040.01115.06
7.4.00.0080.00915.11
7.3.330.0060.00013.63
7.3.320.0000.00513.59
7.3.310.0000.00716.68
7.3.300.0000.00716.79
7.3.290.0090.00616.73
7.3.280.0060.01116.71
7.3.270.0140.00417.40
7.3.260.0050.01816.82
7.3.250.0080.01016.77
7.3.240.0100.00816.63
7.3.230.0130.00316.68
7.3.210.0100.00716.91
7.3.200.0100.01016.75
7.3.190.0030.01316.82
7.3.180.0100.00716.75
7.3.170.0120.00616.80
7.3.160.0060.01116.88
7.3.130.0060.00914.89
7.3.120.0050.01014.85
7.3.110.0100.00914.81
7.3.100.0000.01414.92
7.3.90.0070.00814.98
7.3.80.0070.00515.05
7.3.70.0050.00814.97
7.3.60.0100.00514.88
7.3.50.0040.00614.94
7.3.40.0090.00514.98
7.3.30.0030.01015.05
7.3.20.0030.00816.80
7.3.10.0080.00416.86
7.3.00.0020.01016.66
7.2.330.0200.00316.88
7.2.320.0060.01917.12
7.2.310.0100.01317.12
7.2.300.0160.00317.19
7.2.290.0120.00917.17
7.2.260.0040.01115.31
7.2.250.0030.01415.19
7.2.240.0070.01115.37
7.2.230.0040.01115.28
7.2.220.0080.00815.24
7.2.210.0070.01015.12
7.2.200.0090.00815.33
7.2.190.0050.00815.22
7.2.180.0070.00915.33
7.2.170.0080.00715.25
7.2.160.0040.00815.22
7.2.150.0090.00617.01
7.2.140.0060.00617.02
7.2.130.0060.00917.07
7.2.120.0060.00817.04
7.2.110.0130.00317.23
7.2.100.0030.01317.00
7.2.90.0030.01017.14
7.2.80.0030.00917.11
7.2.70.0110.00317.02
7.2.60.0130.00917.08
7.2.50.0020.00917.18
7.2.40.0060.00616.92
7.2.30.0000.01017.13
7.2.20.0000.01517.05
7.2.10.0060.00917.10
7.2.00.0050.00818.50
7.1.330.0020.01416.01
7.1.320.0030.00815.88
7.1.310.0050.00716.15
7.1.300.0070.00715.84
7.1.290.0040.00815.88
7.1.280.0020.01316.05
7.1.270.0030.01215.90
7.1.260.0030.00715.74
7.1.250.0060.00815.83
7.1.240.0030.01315.93
7.1.230.0030.01015.97
7.1.220.0070.00415.90
7.1.210.0110.00415.74
7.1.200.0090.00515.79
7.1.190.0080.00415.85
7.1.180.0000.01715.95
7.1.170.0000.00816.05
7.1.160.0060.00615.98
7.1.150.0110.00315.81
7.1.140.0140.00315.88
7.1.130.0000.01515.84
7.1.120.0060.00615.77
7.1.110.0030.00516.18
7.1.100.0070.00715.94
7.1.90.0130.00315.93
7.1.80.0070.01315.88
7.1.70.0050.00416.71
7.1.60.0050.00716.71
7.1.50.0060.01016.13
7.1.40.0080.00615.78
7.1.30.0000.01215.94
7.1.20.0080.00015.82
7.1.10.0090.00615.86
7.1.00.0050.04319.22
7.0.330.0100.00315.57
7.0.320.0120.00015.48
7.0.310.0070.00715.52
7.0.300.0000.01215.40
7.0.290.0040.00715.48
7.0.280.0080.00415.51
7.0.270.0000.00815.52
7.0.260.0000.01415.62
7.0.250.0070.00315.52
7.0.240.0030.01015.59
7.0.230.0060.00315.75
7.0.220.0070.01315.46
7.0.210.0070.00715.75
7.0.200.0030.00716.36
7.0.190.0030.00915.55
7.0.180.0100.00315.50
7.0.170.0000.01015.48
7.0.160.0070.00715.60
7.0.150.0040.00815.71
7.0.140.0070.00715.63
7.0.130.0060.01015.61
7.0.120.0080.03018.89
7.0.110.0070.03318.95
7.0.100.0100.03218.89
7.0.90.0050.03718.89
7.0.80.0100.02818.87
7.0.70.0050.03618.94
7.0.60.0100.04018.96
7.0.50.0030.03719.07
7.0.40.0090.04417.93
7.0.30.0110.04017.96
7.0.20.0050.03117.83
7.0.10.0040.03517.99
7.0.00.0030.03517.90
5.6.400.0060.00914.24
5.6.390.0060.00314.48
5.6.380.0070.00414.33
5.6.370.0150.00014.62
5.6.360.0070.00714.13
5.6.350.0000.01014.79
5.6.340.0000.01514.55
5.6.330.0110.00314.73
5.6.320.0030.00614.32
5.6.310.0060.00614.33
5.6.300.0000.00914.84
5.6.290.0030.00614.43
5.6.280.0060.00914.61
5.6.270.0080.03517.71
5.6.260.0090.03117.91
5.6.250.0050.03518.00
5.6.240.0100.03117.95
5.6.230.0050.03817.74
5.6.220.0110.03017.82
5.6.210.0100.04518.01
5.6.200.0040.03717.76
5.6.190.0140.03717.86
5.6.180.0080.04317.80
5.6.170.0050.03717.71
5.6.160.0100.02717.89
5.6.150.0030.03517.76
5.6.140.0020.03717.81
5.6.130.0060.03117.72
5.6.120.0060.03417.79
5.6.110.0050.03917.65
5.6.100.0090.03117.72
5.6.90.0070.03517.74
5.6.80.0100.02817.34
5.6.70.0080.03717.35
5.6.60.0070.03317.33
5.6.50.0080.02817.57
5.6.40.0100.04217.43
5.6.30.0050.03217.45
5.6.20.0080.04017.32
5.6.10.0080.03817.48
5.6.00.0050.03017.47

preferences:
43.89 ms | 400 KiB | 5 Q