3v4l.org

run code in 300+ PHP versions simultaneously
<?php // from your file $xml = ' <div class="DetailsPanel"> <label class="ListLabel left">Location</label> <span id="location" class="ListDetail left" title="London, UK">London, UK</span> <label class="ListLabel left">Price</label> <span id="price" class="ListDetail left" title="£5000">£5000</span> <label class="ListLabel left">Sector</label> <span class="ListDetail left"> <a href="/">IT</a> <a href="/">ICT</a> </span> </div> '; $xmldoc = new DOMDocument(); //$xmldoc->load('yourFile.html'); $xmldoc->loadXML($xml); $xpath = new Domxpath($xmldoc); foreach($xpath->query("//div") as $node){ //$tag = $node->getAttribute('id'); $string = $node->nodeValue; //echo $string . '|'; foreach($xpath->query("//div/label") as $node1){ $string = $node1->nodeValue; //echo $string . "\n"; if($string === 'Sector') { foreach ($xpath->query("//div/span/a") as $sector) { $string = $sector->nodeValue; echo "Sector = " . $string . "\n"; } } if($string === 'Price') { foreach ($xpath->query("//div/span[@id='price']") as $price) { $string = $price->nodeValue; echo "Price = " . $string . "\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.0040.01118.52
8.3.50.0060.00922.18
8.3.40.0090.00919.04
8.3.30.0120.00319.51
8.3.20.0070.00020.71
8.3.10.0040.00422.18
8.3.00.0040.00421.08
8.2.180.0100.01016.88
8.2.170.0200.00022.96
8.2.160.0100.00719.48
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0080.00019.86
8.2.110.0060.00322.62
8.2.100.0130.00019.87
8.2.90.0040.00419.48
8.2.80.0000.00818.18
8.2.70.0000.00818.13
8.2.60.0000.00818.30
8.2.50.0000.00918.07
8.2.40.0070.00320.44
8.2.30.0040.00418.46
8.2.20.0050.00318.07
8.2.10.0000.00918.08
8.2.00.0030.00618.13
8.1.280.0150.00025.92
8.1.270.0030.00622.30
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00624.12
8.1.230.0040.00819.23
8.1.220.0030.00618.15
8.1.210.0080.00018.77
8.1.200.0030.00717.60
8.1.190.0000.00817.88
8.1.180.0090.00018.96
8.1.170.0050.00318.98
8.1.160.0030.00622.33
8.1.150.0000.00719.08
8.1.140.0050.00317.93
8.1.130.0040.00418.08
8.1.120.0040.00417.95
8.1.110.0050.00317.89
8.1.100.0070.00017.95
8.1.90.0000.00717.82
8.1.80.0000.00717.91
8.1.70.0000.00817.91
8.1.60.0040.00417.86
8.1.50.0000.00817.76
8.1.40.0040.00418.01
8.1.30.0000.00818.01
8.1.20.0040.00417.91
8.1.10.0040.00417.91
8.1.00.0000.00817.97
8.0.300.0040.00418.77
8.0.290.0080.00017.55
8.0.280.0070.00018.79
8.0.270.0040.00417.59
8.0.260.0040.00417.27
8.0.250.0000.00817.27
8.0.240.0050.00217.27
8.0.230.0000.00717.42
8.0.220.0000.00717.31
8.0.210.0000.00717.14
8.0.200.0030.00317.40
8.0.190.0030.00617.16
8.0.180.0040.00417.20
8.0.170.0040.00417.36
8.0.160.0040.00417.41
8.0.150.0080.00017.33
8.0.140.0040.00417.31
8.0.130.0030.00313.66
8.0.120.0090.00017.30
8.0.110.0000.00817.37
8.0.100.0040.00417.20
8.0.90.0030.00617.34
8.0.80.0080.00817.16
8.0.70.0080.00017.27
8.0.60.0050.00317.16
8.0.50.0040.00417.12
8.0.30.0120.01117.32
8.0.20.0070.01317.68
8.0.10.0040.00417.20
8.0.00.0100.00717.20
7.4.330.0030.00315.50
7.4.320.0060.00017.06
7.4.300.0060.00016.84
7.4.290.0000.00716.90
7.4.280.0030.00516.91
7.4.270.0070.00016.92
7.4.260.0060.00316.99
7.4.250.0040.00416.89
7.4.240.0010.00616.96
7.4.230.0040.00416.96
7.4.220.0120.00616.99
7.4.210.0130.00516.98
7.4.200.0000.00716.99
7.4.190.0000.00717.05
7.4.160.0080.01216.75
7.4.150.0120.00417.40
7.4.140.0140.00617.86
7.4.130.0150.00616.94
7.4.120.0080.00916.85
7.4.110.0100.00716.91
7.4.100.0070.01016.86
7.4.90.0090.00916.84
7.4.80.0090.00919.39
7.4.70.0070.01016.66
7.4.60.0140.00416.79
7.4.50.0030.00616.86
7.4.40.0030.01322.77
7.4.30.0060.01016.90
7.4.00.0070.01115.05
7.3.330.0030.00313.62
7.3.320.0050.00013.54
7.3.310.0000.00716.82
7.3.300.0030.00316.80
7.3.290.0000.01516.74
7.3.280.0050.01316.73
7.3.270.0060.01617.40
7.3.260.0090.01617.03
7.3.250.0110.00716.71
7.3.240.0120.01316.92
7.3.230.0040.01516.64
7.3.210.0160.00416.59
7.3.200.0030.01319.39
7.3.190.0060.01116.62
7.3.180.0000.01616.78
7.3.170.0060.01217.06
7.3.160.0160.00016.90
7.3.120.0110.00315.06
7.2.330.0090.01517.11
7.2.320.0060.01217.05
7.2.310.0030.01917.07
7.2.300.0060.01017.18
7.2.290.0130.00317.18
7.2.00.0030.01519.84
7.1.100.0060.00618.23
7.1.70.0030.00517.22
7.1.60.0060.01919.82
7.1.50.0130.01016.99
7.1.00.0100.07022.49
7.0.200.0000.00816.88
7.0.140.0130.06722.31
7.0.60.0100.07720.09
7.0.50.0130.06318.05
7.0.40.0070.08720.46
7.0.30.0300.07320.48
7.0.20.0370.06720.48
7.0.10.0270.07320.24
7.0.00.0070.08020.48
5.6.280.0000.07721.25
5.6.210.0100.07020.92
5.6.200.0070.03718.41
5.6.190.0070.07720.68
5.6.180.3730.04020.57
5.6.170.0270.08320.60
5.6.160.0030.08720.66
5.6.150.0000.05018.27
5.6.140.0100.08018.43
5.6.130.0000.04318.40
5.6.120.0030.05721.25
5.6.110.0030.08321.17
5.6.100.0070.04321.20
5.6.90.0000.04721.19
5.6.80.0130.07320.60
5.6.70.0300.06020.60
5.5.350.0030.07020.58
5.5.340.0100.05018.18
5.5.330.0100.08320.43
5.5.320.0300.03720.50
5.5.310.0400.07720.48
5.5.300.0070.07318.20
5.5.290.0030.04018.11
5.5.280.0000.04321.10
5.5.270.0070.07321.14
5.5.260.0030.04020.96
5.5.250.0130.08320.73
5.5.240.0100.07720.35
5.4.450.0230.04319.61
5.4.440.0500.06019.60
5.4.430.0070.06719.48
5.4.420.0130.05319.52
5.4.410.0100.05319.50
5.4.400.0800.00018.92
5.4.390.0770.00018.81
5.4.380.0300.06318.82
5.4.370.0270.05318.88
5.4.360.0200.05718.90
5.4.350.0270.05318.91
5.4.340.0170.06018.66
5.4.320.0090.03512.78
5.4.310.0090.04312.78
5.4.300.0110.03612.79
5.4.290.0050.04212.78
5.4.280.0110.03712.68
5.4.270.0040.03912.68
5.4.260.0100.07718.95
5.4.250.0130.05318.97
5.4.240.0100.05319.03
5.4.230.0130.06718.94
5.4.220.0030.05718.85
5.4.210.0030.05719.04
5.4.200.0130.04318.93
5.4.190.0100.05019.20
5.4.180.0030.05719.20
5.4.170.0070.05719.32
5.4.160.0070.05019.22
5.4.150.0170.07319.06
5.4.140.0070.08016.39
5.4.130.0030.05016.40
5.4.120.0100.04716.40
5.4.110.0130.04716.75
5.4.100.0070.06016.72
5.4.90.0100.04316.75
5.4.80.0170.03716.78
5.4.70.0000.05716.71
5.4.60.0100.04716.73
5.4.50.0130.04316.54
5.4.40.0070.04716.70
5.4.30.0100.05316.72
5.4.20.0170.04716.55
5.4.10.0070.05016.63
5.4.00.0130.04315.88
5.3.290.0080.03913.05
5.3.280.0030.06014.66
5.3.270.0130.05014.72
5.3.260.0070.05314.75
5.3.250.0130.04714.70
5.3.240.0170.04014.71
5.3.230.0100.05014.71
5.3.220.0000.05714.67
5.3.210.0000.06314.66
5.3.200.0070.05014.77
5.3.190.0000.05714.63
5.3.180.0100.04714.68
5.3.170.0100.04714.80
5.3.160.0070.05014.64
5.3.150.0100.04714.68
5.3.140.0130.06014.67
5.3.130.0100.05014.78
5.3.120.0070.05314.73
5.3.110.0000.07714.76
5.3.100.0170.04714.14
5.3.90.0100.07314.16
5.3.80.0070.05014.20
5.3.70.0100.04714.06
5.3.60.0000.05314.14
5.3.50.0130.04314.01
5.3.40.0070.05014.09
5.3.30.0030.05314.04
5.3.20.0070.06013.91
5.3.10.0070.05313.71
5.3.00.0000.05313.70
5.2.170.0100.05711.27
5.2.160.0200.04011.33
5.2.150.0130.03311.23
5.2.140.0030.04311.22
5.2.130.0100.03711.38
5.2.120.0030.04311.22
5.2.110.0030.04011.21
5.2.100.0030.04311.29
5.2.90.0100.03311.21
5.2.80.0030.04311.36
5.2.70.0030.04311.31
5.2.60.0030.04311.16
5.2.50.0070.05011.10
5.2.40.0070.03711.31
5.2.30.0000.04311.08
5.2.20.0070.05311.07
5.2.10.0100.03311.04
5.2.00.0070.03710.89
5.1.60.0070.03310.24
5.1.50.0030.03710.39
5.1.40.0070.03310.21
5.1.30.0030.05010.57
5.1.20.0100.04310.48
5.1.10.0000.04010.23
5.1.00.0030.03710.46
5.0.50.0070.0278.70
5.0.40.0100.0238.55
5.0.30.0000.0538.47
5.0.20.0070.0238.34
5.0.10.0000.0308.30
5.0.00.0030.0438.43
4.4.90.0000.0238.10
4.4.80.0030.0208.10
4.4.70.0000.0238.10
4.4.60.0030.0208.10
4.4.50.0070.0178.10
4.4.40.0030.0338.10
4.4.30.0070.0178.10
4.4.20.0000.0238.10
4.4.10.0000.0238.10
4.4.00.0000.0438.10
4.3.110.0000.0338.10
4.3.100.0000.0238.10
4.3.90.0030.0208.10
4.3.80.0000.0338.10
4.3.70.0000.0238.10
4.3.60.0070.0278.10
4.3.50.0070.0178.10
4.3.40.0070.0338.10
4.3.30.0030.0208.10
4.3.20.0000.0238.10
4.3.10.0000.0338.10
4.3.00.0000.0239.21

preferences:
45.8 ms | 401 KiB | 5 Q