3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = "<div class='parent'> <div class='title'>A Title</div> <div class='child'>some text</div> <div class='child'>some text</div> <div class='title'>A Title</div> <div class='child'>some text</div> <div class='child'>some text</div> </div>"; $dom = new DOMDocument(); $dom->loadHTML($xml); $xpath = new DOMXPath($dom); $xpqueries = array( "//div[@class='parent']/div", "//div[@class='xparent']/div", ); foreach ($xpqueries as $xpquery) { $dnode = $xpath->query($xpquery); if ($dnode && $dnode->length > 0) { echo "query '{$xpquery}' results in {$dnode->length} nodes. '" . htmlentities($dnode->item(0)->nodeValue) . "' is the first item, '" . htmlentities($dnode->item($dnode->length - 1)->nodeValue) . "' is the last.<br />"; } else { echo "query '{$xpquery}' results in {$dnode->length} nodes.<br />"; } } return;

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.0180.00417.00
8.3.50.0080.01022.06
8.3.40.0070.00718.79
8.3.30.0110.00419.37
8.3.20.0060.00320.57
8.3.10.0090.00023.82
8.3.00.0040.00419.39
8.2.180.0150.00618.46
8.2.170.0120.00622.96
8.2.160.0110.00720.54
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0080.00021.21
8.2.110.0030.00722.70
8.2.100.0060.00618.47
8.2.90.0000.00819.42
8.2.80.0040.00417.97
8.2.70.0030.00917.75
8.2.60.0060.00318.41
8.2.50.0080.00018.07
8.2.40.0030.00620.26
8.2.30.0050.00218.67
8.2.20.0030.00517.96
8.2.10.0000.00718.42
8.2.00.0070.00318.09
8.1.280.0070.01125.92
8.1.270.0090.00024.32
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0070.00324.20
8.1.230.0090.00319.46
8.1.220.0050.00318.16
8.1.210.0070.00318.77
8.1.200.0030.00817.60
8.1.190.0030.00617.47
8.1.180.0050.00319.38
8.1.170.0030.00718.84
8.1.160.0070.00022.30
8.1.150.0080.00018.97
8.1.140.0000.00917.68
8.1.130.0000.00718.20
8.1.120.0040.00417.70
8.1.110.0100.00017.81
8.1.100.0000.00717.84
8.1.90.0000.00817.85
8.1.80.0070.00017.81
8.1.70.0040.00417.78
8.1.60.0060.00317.81
8.1.50.0060.00317.92
8.1.40.0060.00317.86
8.1.30.0040.00417.88
8.1.20.0040.00417.97
8.1.10.0040.00417.98
8.1.00.0040.00417.88
8.0.300.0050.00218.77
8.0.290.0000.00817.68
8.0.280.0000.00718.81
8.0.270.0030.00317.58
8.0.260.0030.00317.55
8.0.250.0030.00317.19
8.0.240.0070.00017.30
8.0.230.0030.00317.31
8.0.220.0030.00317.18
8.0.210.0070.00017.20
8.0.200.0000.00817.20
8.0.190.0040.00417.29
8.0.180.0000.00817.25
8.0.170.0040.00417.26
8.0.160.0000.00817.30
8.0.150.0040.00417.25
8.0.140.0040.00417.14
8.0.130.0000.00613.65
8.0.120.0060.00317.15
8.0.110.0040.00417.13
8.0.100.0060.00317.04
8.0.90.0000.00717.26
8.0.80.0070.01017.30
8.0.70.0040.00417.15
8.0.60.0000.00817.30
8.0.50.0060.00317.09
8.0.30.0110.00917.58
8.0.20.0070.01217.42
8.0.10.0030.00517.22
8.0.00.0110.00817.22
7.4.330.0050.00015.36
7.4.320.0030.00316.84
7.4.300.0060.00016.96
7.4.290.0030.00316.93
7.4.280.0030.00316.88
7.4.270.0040.00416.77
7.4.260.0030.00316.85
7.4.250.0000.00716.89
7.4.240.0070.00016.78
7.4.230.0040.00417.06
7.4.220.0130.00416.97
7.4.210.0080.01117.00
7.4.200.0080.00017.06
7.4.190.0040.00416.88
7.4.160.0100.00616.85
7.4.150.0160.00817.40
7.4.140.0090.01217.86
7.4.130.0120.00716.90
7.4.120.0100.00916.78
7.4.110.0130.01016.71
7.4.100.0060.01216.69
7.4.90.0080.00816.77
7.4.80.0090.00919.39
7.4.70.0150.00316.86
7.4.60.0110.00716.79
7.4.50.0060.00316.93
7.4.40.0180.00516.88
7.4.30.0160.00416.88
7.4.00.0060.01115.12
7.3.330.0050.00013.45
7.3.320.0070.00013.55
7.3.310.0070.00016.60
7.3.300.0000.00716.73
7.3.290.0100.00316.66
7.3.280.0080.01016.68
7.3.270.0100.00617.40
7.3.260.0060.01216.58
7.3.250.0120.00916.79
7.3.240.0130.00616.64
7.3.230.0120.00916.80
7.3.210.0130.00616.59
7.3.200.0100.00716.75
7.3.190.0030.01416.74
7.3.180.0000.01616.62
7.3.170.0030.01316.95
7.3.160.0120.00816.80
7.3.120.0090.00814.98
7.3.110.0070.01214.89
7.3.100.0070.00815.06
7.3.90.0080.00514.96
7.3.80.0040.01015.09
7.3.70.0040.00715.05
7.3.60.0040.01114.97
7.3.50.0060.00715.06
7.3.40.0030.00915.00
7.3.30.0020.00814.87
7.3.20.0090.00516.92
7.3.10.0050.00916.82
7.3.00.0040.00816.82
7.2.330.0130.00617.06
7.2.320.0130.00816.71
7.2.310.0060.01517.11
7.2.300.0120.00316.85
7.2.290.0060.01216.71
7.2.250.0080.01015.28
7.2.240.0070.01215.48
7.2.230.0070.01015.40
7.2.220.0040.01115.33
7.2.210.0060.00815.32
7.2.200.0060.00815.24
7.2.190.0070.01015.19
7.2.180.0030.01215.11
7.2.170.0040.01115.16
7.2.130.0030.00916.87
7.2.120.0070.00717.14
7.2.110.0040.00817.36
7.2.100.0000.01817.08
7.2.90.0110.00317.16
7.2.80.0000.01217.13
7.2.70.0040.00716.95
7.2.60.0070.00517.08
7.2.50.0110.00017.29
7.2.40.0030.01017.12
7.2.30.0030.00816.91
7.2.20.0070.00717.05
7.2.10.0070.00717.12
7.2.00.0030.01018.30
7.1.330.0050.01015.84
7.1.320.0050.00716.12
7.1.310.0090.00415.86
7.1.300.0050.00615.86
7.1.290.0030.01015.95
7.1.280.0030.00815.81
7.1.270.0040.00816.01
7.1.260.0060.00815.97
7.1.250.0040.00415.99
7.1.200.0040.00816.11
7.1.100.0160.00317.99
7.1.70.0030.00517.37
7.1.60.0070.01119.46
7.1.50.0090.01417.21
7.1.00.0100.07322.45
7.0.200.0000.01017.03
7.0.140.0000.07722.07
7.0.60.0130.08019.93
7.0.50.0100.04018.10
7.0.40.0100.05020.10
7.0.30.0170.04320.38
7.0.20.0230.07720.32
7.0.10.0100.08720.36
7.0.00.0070.05320.39
5.6.280.0000.07721.21
5.6.210.0100.08320.64
5.6.200.0130.07718.37
5.6.190.0100.06020.55
5.6.180.4070.04020.75
5.6.170.0230.05720.85
5.6.160.0070.04720.46
5.6.150.0000.05318.26
5.6.140.0030.04018.38
5.6.130.0070.07718.36
5.6.120.0070.08321.15
5.6.110.0130.07021.17
5.6.100.0170.06721.01
5.6.90.0100.06721.14
5.6.80.0030.07020.58
5.6.70.4200.04020.58
5.5.350.0330.07320.53
5.5.340.0130.03318.12
5.5.330.0130.07720.40
5.5.320.0230.04720.39
5.5.310.0200.06020.66
5.5.300.0070.04718.15
5.5.290.0170.06318.13
5.5.280.0030.05321.06
5.5.270.0030.05021.08
5.5.260.0100.04721.05
5.5.250.0070.07020.77
5.5.240.0200.08020.36
5.4.450.0630.05019.39
5.4.440.0800.05319.44
5.4.430.0970.06719.57
5.4.420.0970.05719.59
5.4.410.0800.05719.45
5.4.400.0770.06019.00
5.4.390.1030.05019.25
5.4.380.0230.04318.65
5.4.370.0200.04318.90
5.4.360.0200.04318.79
5.4.350.0170.05018.84
5.4.340.0130.05018.69
5.4.320.0060.03712.72
5.4.310.0060.03812.71
5.4.300.0050.04612.71
5.4.290.0060.03912.71
5.4.280.0020.04012.61
5.4.270.0040.04612.61
5.4.260.0080.03812.61
5.4.250.0050.05012.61
5.4.240.0100.05112.61
5.4.230.0050.04112.60
5.4.220.0080.03612.61
5.4.210.0050.03712.61
5.4.200.0090.03812.60
5.4.190.0070.03812.60
5.4.180.0070.03612.60
5.4.170.0040.03912.61
5.4.160.0040.03712.61
5.4.150.0110.03512.60
5.4.140.0090.03512.28
5.4.130.0070.03612.27
5.4.120.0060.03712.23
5.4.110.0070.04112.23
5.4.100.0070.04512.22
5.4.90.0060.03612.23
5.4.80.0060.03912.23
5.4.70.0040.03712.22
5.4.60.0050.03612.22
5.4.50.0060.03412.22
5.4.40.0050.04112.20
5.4.30.0050.03712.21
5.4.20.0060.03612.20
5.4.10.0060.03412.20
5.4.00.0030.03911.70
5.3.290.0080.03912.98
5.3.280.0050.04212.91
5.3.270.0060.04212.92
5.3.260.0050.04412.92
5.3.250.0040.04012.91
5.3.240.0110.03612.92
5.3.230.0060.04112.91
5.3.220.0100.03612.88
5.3.210.0060.04012.88
5.3.200.0050.03812.88
5.3.190.0070.03612.88
5.3.180.0060.03612.88
5.3.170.0050.03812.88
5.3.160.0050.03612.88
5.3.150.0070.03612.88
5.3.140.0070.03512.86
5.3.130.0090.03812.86
5.3.120.0040.04112.86
5.3.110.0050.03912.86
5.3.100.0040.03912.35
5.3.90.0060.03712.34
5.3.80.0080.03412.32
5.3.70.0050.03712.32
5.3.60.0050.03712.31
5.3.50.0070.03712.25
5.3.40.0050.03712.26
5.3.30.0070.03412.21
5.3.20.0050.03612.00
5.3.10.0050.03711.96
5.3.00.0060.04111.95
5.2.170.0080.0339.45
5.2.160.0020.0339.45
5.2.150.0030.0329.45
5.2.140.0060.0329.44
5.2.130.0060.0319.40
5.2.120.0040.0329.41
5.2.110.0080.0519.41
5.2.100.0040.0419.40
5.2.90.0060.0319.41
5.2.80.0040.0339.40
5.2.70.0060.0329.40
5.2.60.0080.0309.35
5.2.50.0040.0339.32
5.2.40.0090.0259.30
5.2.30.0060.0299.27
5.2.20.0070.0329.26
5.2.10.0090.0339.20
5.2.00.0050.0339.07
5.1.60.0030.0318.35
5.1.50.0050.0358.35
5.1.40.0050.0368.33
5.1.30.0050.0298.68
5.1.20.0050.0268.70
5.1.10.0060.0308.43
5.1.00.0050.0278.42
5.0.50.0030.0216.91
5.0.40.0040.0246.77
5.0.30.0040.0346.60
5.0.20.0060.0206.56
5.0.10.0020.0216.53
5.0.00.0050.0306.52
4.4.90.0020.0184.78
4.4.80.0020.0214.75
4.4.70.0040.0204.76
4.4.60.0030.0224.76
4.4.50.0060.0194.77
4.4.40.0050.0244.71
4.4.30.0030.0154.76
4.4.20.0030.0154.85
4.4.10.0030.0234.85
4.4.00.0040.0264.76
4.3.110.0040.0154.67
4.3.100.0010.0184.66
4.3.90.0030.0154.64
4.3.80.0020.0244.58
4.3.70.0010.0164.63
4.3.60.0030.0144.63
4.3.50.0030.0214.63
4.3.40.0030.0234.54
4.3.30.0010.0173.30
4.3.20.0020.0163.28
4.3.10.0020.0153.23
4.3.00.0100.01016.12

preferences:
73.96 ms | 401 KiB | 5 Q