3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = ' <table id="myTable"> <tbody> <tr> <td>08/20/18</td> <td> <a href="https://example.com/1a">Text 1 A</a> </td> <td> <a href="https://example.com/1b">Test 1 B</a> </td> </tr> <tr> <td>08/21/18</td> <td> <a href="https://example.com/2a">Text 2 A</a> </td> <td> <a href="https://example.com/2b">Test 2 B</a> </td> </tr> </tbody> </table> '; $data = []; $doc = new DOMDocument(); $doc->loadHTML('<?xml encoding="utf-8" ?>' . $html); $xpath = new DOMXPath($doc); $trs = $xpath->query("//*[@id='myTable']/tbody/tr"); foreach ($trs as $i => $tr) { /** @var DOMElement $td */ foreach ($tr->childNodes as $td) { if ($td instanceof DOMElement) { $row = []; /** @var DOMElement $a */ foreach ($td->childNodes as $a) { /** @var DOMAttr $attribute */ foreach ($a->attributes as $attribute) { $row[$attribute->name] = $attribute->value; } $row['content'] = $td->nodeValue; } $data[$i][] = $row; } } } print_r($data);

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.5.20.0110.00719.88
8.5.10.0110.01016.88
8.5.00.0140.00820.43
8.4.170.0140.00921.15
8.4.160.0150.00722.00
8.4.150.0030.00014.05
8.4.140.0130.01018.19
8.4.130.0060.00318.13
8.4.120.0130.00721.05
8.4.110.0100.00622.72
8.4.100.0100.01018.42
8.4.90.0120.00519.26
8.4.80.0010.00718.40
8.4.70.0120.01218.39
8.4.60.0110.01219.36
8.4.50.0120.00919.25
8.4.40.0150.00620.04
8.4.30.0160.00618.82
8.4.20.0100.01018.78
8.4.10.0100.01018.11
8.3.300.0140.00821.23
8.3.290.0130.00621.14
8.3.280.0160.00518.87
8.3.270.0090.01117.06
8.3.260.0080.00916.89
8.3.250.0150.00419.43
8.3.240.0110.00817.00
8.3.230.0110.00917.17
8.3.220.0110.00717.57
8.3.210.0120.00817.29
8.3.200.0030.00617.15
8.3.190.0090.00717.43
8.3.180.0100.01017.26
8.3.170.0080.00021.24
8.3.160.0150.00317.38
8.3.150.0110.00719.23
8.3.140.0160.00317.13
8.3.130.0050.00518.88
8.3.120.0090.00619.30
8.3.110.0060.00317.40
8.3.100.0050.00324.06
8.3.90.0130.00726.77
8.3.80.0030.00617.97
8.3.70.0100.00619.05
8.3.60.0090.00618.73
8.3.50.0100.00418.21
8.3.40.0120.00319.16
8.3.30.0060.00919.26
8.3.20.0040.00419.41
8.3.10.0050.00323.86
8.3.00.0080.00022.81
8.2.300.0110.00922.60
8.2.290.0120.00821.17
8.2.280.0060.00217.28
8.2.270.0160.00317.57
8.2.260.0090.00618.87
8.2.250.0040.00417.12
8.2.240.0030.01219.50
8.2.230.0050.00320.94
8.2.220.0000.00837.54
8.2.210.0100.00026.77
8.2.200.0030.00618.91
8.2.190.0150.00316.88
8.2.180.0040.01118.44
8.2.170.0070.00722.96
8.2.160.0150.00421.69
8.2.150.0080.00024.18
8.2.140.0050.00524.66
8.2.130.0080.00022.59
8.2.120.0080.00026.35
8.2.110.0070.00321.54
8.2.100.0090.00318.41
8.2.90.0010.00818.51
8.2.80.0040.00418.00
8.2.70.0000.00818.18
8.2.60.0040.00418.59
8.2.50.0040.00418.10
8.2.40.0040.00419.43
8.2.30.0000.00821.02
8.2.20.0030.00518.42
8.2.10.0000.00818.43
8.2.00.0030.00519.86
8.1.340.0130.00717.96
8.1.330.0110.00820.77
8.1.320.0120.00916.43
8.1.310.0150.00417.18
8.1.300.0080.00018.68
8.1.290.0090.00030.84
8.1.280.0160.00025.92
8.1.270.0080.00024.20
8.1.260.0000.00826.35
8.1.250.0000.00828.09
8.1.240.0040.00418.21
8.1.230.0040.00719.43
8.1.220.0030.00518.18
8.1.210.0000.00818.77
8.1.200.0000.01117.73
8.1.190.0030.00517.73
8.1.180.0030.00518.10
8.1.170.0090.00019.18
8.1.160.0060.00319.23
8.1.150.0040.00419.24
8.1.140.0040.00419.39
8.1.130.0000.00721.23
8.1.120.0040.00417.77
8.1.110.0060.00617.83
8.1.100.0030.00517.81
8.1.90.0040.00417.74
8.1.80.0080.00017.78
8.1.70.0050.00317.87
8.1.60.0040.00417.96
8.1.50.0040.00417.88
8.1.40.0000.01117.90
8.1.30.0030.00617.85
8.1.20.0030.00617.96
8.1.10.0040.00417.89
8.1.00.0000.00717.92
8.0.300.0060.00318.77
8.0.290.0060.00317.13
8.0.280.0040.00418.73
8.0.270.0000.00717.55
8.0.260.0000.00720.80
8.0.250.0070.00017.39
8.0.240.0000.00817.39
8.0.230.0050.00317.22
8.0.220.0030.00317.32
8.0.210.0030.00317.34
8.0.200.0000.00717.21
8.0.190.0040.00417.39
8.0.180.0040.00417.32
8.0.170.0080.00017.34
8.0.160.0040.00417.21
8.0.150.0030.00317.17
8.0.140.0040.00417.30
8.0.130.0000.00613.73
8.0.120.0030.00617.27
8.0.110.0050.00317.31
8.0.100.0040.00417.35
8.0.90.0060.00317.21
8.0.80.0090.00617.32
8.0.70.0050.00317.36
8.0.60.0060.00217.27
8.0.50.0000.00817.21
8.0.30.0110.00817.37
8.0.20.0080.00617.39
8.0.10.0050.00317.41
8.0.00.0090.00917.37
7.4.330.0030.00315.55
7.4.320.0030.00316.99
7.4.300.0000.00616.95
7.4.290.0030.00516.88
7.4.280.0040.00416.79
7.4.270.0090.00016.88
7.4.260.0030.00516.70
7.4.250.0000.00716.95
7.4.240.0060.00316.98
7.4.230.0040.00416.93
7.4.220.0010.00716.86
7.4.210.0060.00716.85
7.4.200.0020.00616.84
7.4.190.0090.00016.95
7.4.180.0030.00616.96
7.4.160.0080.00916.94
7.4.150.0000.00916.99
7.4.140.0090.00717.66
7.4.130.0060.00916.80
7.4.120.0090.00616.91
7.4.110.0070.00716.80
7.4.100.0060.00716.86
7.4.90.0080.00516.82
7.4.80.0050.01218.10
7.4.70.0050.00716.87
7.4.60.0050.00716.94
7.4.50.0060.00616.92
7.4.40.0050.01016.73
7.4.30.0020.00616.89
7.4.20.0030.00616.61
7.4.10.0000.00816.75
7.4.00.0050.00815.77
7.3.330.0000.00613.64
7.3.320.0060.00013.42
7.3.310.0070.00016.80
7.3.300.0020.00616.76
7.3.290.0020.00616.79
7.3.280.0070.00416.61
7.3.270.0080.00016.78
7.3.260.0080.01016.79
7.3.250.0000.01016.70
7.3.240.0090.00716.79
7.3.230.0090.00616.67
7.3.220.0040.00416.70
7.3.210.0050.00716.78
7.3.200.0040.01216.73
7.3.190.0030.00916.79
7.3.180.0050.00816.71
7.3.170.0070.00516.71
7.3.160.0080.00416.63
7.3.150.0030.00616.68
7.3.140.0080.00016.68
7.3.130.0050.00316.80
7.3.120.0070.00615.63
7.3.110.0060.00615.42
7.3.100.0070.00615.66
7.3.90.0060.00415.72
7.3.80.0050.00815.49
7.3.70.0040.00915.55
7.3.60.0040.00915.51
7.3.50.0030.01015.56
7.3.40.0050.00515.58
7.3.30.0080.00615.57
7.3.20.0050.00817.37
7.3.10.0060.00917.35
7.3.00.0030.00917.33
7.2.340.0080.00616.82
7.2.330.0100.00616.86
7.2.320.0150.00416.88
7.2.310.0130.00316.99
7.2.300.0100.00516.91
7.2.290.0110.00517.02
7.2.280.0110.00316.70
7.2.270.0140.00016.80
7.2.260.0150.00016.80
7.2.250.0060.00916.07
7.2.240.0090.00815.81
7.2.230.0050.01015.77
7.2.220.0060.00715.74
7.2.210.0080.00915.83
7.2.200.0080.00915.82
7.2.190.0060.00815.86
7.2.180.0080.00615.83
7.2.170.0080.00515.82
7.2.160.0060.00816.21
7.2.150.0100.00317.92
7.2.140.0110.00417.98
7.2.130.0110.00518.04
7.2.120.0070.00817.92
7.2.110.0060.01018.03
7.2.100.0080.00518.01
7.2.90.0460.00117.00
7.2.80.0290.00816.88
7.2.70.0350.00517.05
7.2.60.0350.00417.08
7.2.50.0290.00816.98
7.2.40.0300.01017.14
7.2.30.0320.00717.11
7.2.20.0280.00517.01
7.2.10.0390.00417.13
7.2.00.0530.01017.15
7.1.330.0040.00916.64
7.1.320.0060.00916.66
7.1.310.0050.01116.51
7.1.300.0060.00816.60
7.1.290.0040.01016.52
7.1.280.0020.01216.34
7.1.270.0050.00916.50
7.1.260.0090.00416.48
7.1.250.0070.00716.96
7.1.240.0150.00017.61
7.1.230.0100.00417.69
7.1.220.0100.00417.69
7.1.210.0510.00916.08
7.1.200.0420.00316.02
7.1.190.0530.00415.77
7.1.180.0420.00315.94
7.1.170.0460.00815.94
7.1.160.0400.00415.78
7.1.150.0430.00515.79
7.1.140.0520.00715.83
7.1.130.1080.00715.75
7.1.120.0510.00615.96
7.1.110.0420.00315.77
7.1.100.0560.00715.81
7.1.90.0750.00615.81
7.1.80.0910.00515.83
7.1.70.0620.00515.79
7.1.60.0610.01024.81
7.1.50.0770.00424.65
7.1.40.0760.00524.84
7.1.30.1520.00824.72
7.1.20.0990.00824.71
7.1.10.0710.00515.74
7.1.00.0770.00715.78
7.0.330.0110.00417.23
7.0.320.0110.00317.32
7.0.310.0090.00617.49
7.0.300.0140.00017.42
7.0.290.0050.00917.40
7.0.280.0100.00317.29
7.0.270.0090.00517.26
7.0.260.0060.00717.40
7.0.250.0090.00417.46
7.0.240.0070.00717.38
7.0.230.0080.00617.35
7.0.220.0060.00617.40
7.0.210.0110.00317.52
7.0.200.0080.00617.56
7.0.190.0050.00917.47
7.0.180.0090.00517.45
7.0.170.0090.00417.41
7.0.160.0090.00417.29
7.0.150.0070.00817.46
7.0.140.0100.00417.43
7.0.130.0030.01017.55
7.0.120.0040.00817.42
7.0.110.0070.00717.28
7.0.100.0080.00617.21
7.0.90.0140.00017.36
7.0.80.0100.00717.33
7.0.70.0080.00617.35
7.0.60.0130.00017.32
7.0.50.0130.00017.31
7.0.40.0110.00417.34
7.0.30.0110.00217.39
7.0.20.0100.00317.38
7.0.10.0040.00917.33
7.0.00.0040.01017.34
5.6.400.0110.00316.36
5.6.390.0100.00516.39
5.6.380.0150.00016.38
5.6.370.0130.00316.38
5.6.360.0070.00616.18
5.6.350.0130.00016.11
5.6.340.0100.00316.12
5.6.330.0030.01116.18
5.6.320.0080.00516.45
5.6.310.0060.00816.23
5.6.300.0060.00716.01
5.6.290.0090.00516.21
5.6.280.0060.00816.18
5.6.270.0080.00616.43
5.6.260.0070.00716.07
5.6.250.0090.00516.33
5.6.240.0090.00416.25
5.6.230.0110.00316.34
5.6.220.0090.00316.44
5.6.210.0090.00516.41
5.6.200.0050.00716.42
5.6.190.0040.00916.27
5.6.180.0040.00916.17
5.6.170.0090.00416.59
5.6.160.0080.00516.37
5.6.150.0030.01016.50
5.6.140.0080.00416.35
5.6.130.0080.00616.23
5.6.120.0100.00316.48
5.6.110.0090.00416.24
5.6.100.0030.01016.32
5.6.90.0100.00316.24
5.6.80.0040.00816.14
5.6.70.0060.00616.25
5.6.60.0070.00716.22
5.6.50.0100.00316.12
5.6.40.0080.00416.30
5.6.30.0030.00816.48
5.6.20.0090.00316.32
5.6.10.0110.00016.20
5.6.00.0060.00616.25

preferences:
33.77 ms | 403 KiB | 5 Q