3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @link http://stackoverflow.com/a/23543493/367456 */ $html = '<body>... <th class="name" align="left" scope="col"> <a class="foo" href="foo.html">foo</a> </th> ... <th class="name" align="left" scope="col"> <a class="bar" href="bar.html">bar</a> </th> ... <th class="name" align="left" scope="col"> <a class="ba" href="baz.html">baz</a> </th></body>'; $names = function($html) { $doc = new DOMDocument(); $last = libxml_use_internal_errors(TRUE); $doc->loadHTML($html); libxml_use_internal_errors($last); $xp = new DOMXPath($doc); $result = []; foreach ($xp->query("//*[contains(concat(' ', normalize-space(@class), ' '), ' name ')]") as $node) $result[trim($node->textContent)] = 1; return array_keys($result); }; echo json_encode(["names" => $names($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.0040.01118.80
8.3.50.0120.00822.17
8.3.40.0100.01019.26
8.3.30.0000.01419.09
8.3.20.0050.00319.20
8.3.10.0080.00021.48
8.3.00.0070.00723.78
8.2.180.0120.00618.79
8.2.170.0120.00322.96
8.2.160.0110.00620.72
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0000.00821.50
8.2.110.0060.00320.85
8.2.100.0060.00618.22
8.2.90.0030.00619.55
8.2.80.0000.00817.97
8.2.70.0000.01118.00
8.2.60.0080.00418.30
8.2.50.0090.00018.07
8.2.40.0040.00418.41
8.2.30.0070.00021.52
8.2.20.0080.00018.12
8.2.10.0000.00818.27
8.2.00.0000.01118.07
8.1.280.0040.01125.92
8.1.270.0080.00023.99
8.1.260.0090.00926.35
8.1.250.0050.00328.09
8.1.240.0100.00322.97
8.1.230.0030.01021.16
8.1.220.0080.00018.77
8.1.210.0050.00519.29
8.1.200.0030.00717.85
8.1.190.0040.00418.03
8.1.180.0000.00818.16
8.1.170.0030.00518.95
8.1.160.0040.00419.30
8.1.150.0080.00019.00
8.1.140.0050.00217.77
8.1.130.0040.00417.72
8.1.120.0000.00717.78
8.1.110.0000.00717.70
8.1.100.0030.00417.78
8.1.90.0000.00717.70
8.1.80.0030.00517.71
8.1.70.0030.00317.76
8.1.60.0000.00917.96
8.1.50.0040.00417.87
8.1.40.0040.00417.91
8.1.30.0080.00017.90
8.1.20.0040.00418.08
8.1.10.0080.00017.91
8.1.00.0030.00617.94
8.0.300.0060.00320.40
8.0.290.0040.00417.68
8.0.280.0040.00418.83
8.0.270.0040.00417.55
8.0.260.0000.00717.11
8.0.250.0000.00717.36
8.0.240.0050.00717.22
8.0.230.0070.00017.30
8.0.220.0070.00317.19
8.0.210.0070.00017.29
8.0.200.0030.00317.29
8.0.190.0000.00717.15
8.0.180.0040.00417.20
8.0.170.0040.00417.18
8.0.160.0030.00517.13
8.0.150.0040.00417.22
8.0.140.0040.00417.16
8.0.130.0030.00313.61
8.0.120.0070.00017.22
8.0.110.0030.00617.21
8.0.100.0030.00517.32
8.0.90.0080.00017.18
8.0.80.0140.00417.24
8.0.70.0100.00017.32
8.0.60.0030.00617.14
8.0.50.0000.00817.04
8.0.30.0070.01217.29
8.0.20.0130.01017.52
8.0.10.0000.00817.42
8.0.00.0050.01417.32
7.4.330.0050.00015.23
7.4.320.0030.00316.83
7.4.300.0000.00616.95
7.4.290.0080.00016.96
7.4.280.0030.00616.83
7.4.270.0030.00316.85
7.4.260.0030.00313.61
7.4.250.0090.00016.90
7.4.240.0020.00517.00
7.4.230.0030.00416.63
7.4.220.0110.00716.71
7.4.210.0100.00816.94
7.4.200.0000.00717.04
7.4.190.0030.00516.82
7.4.160.0130.00617.05
7.4.150.0040.01617.40
7.4.140.0140.00717.86
7.4.130.0120.00516.88
7.4.120.0080.01316.92
7.4.110.0030.01517.03
7.4.100.0070.01516.64
7.4.90.0120.01116.76
7.4.80.0120.00619.39
7.4.70.0130.00316.68
7.4.60.0160.00617.01
7.4.50.0000.00816.78
7.4.40.0030.01222.77
7.4.30.0100.00917.00
7.4.00.0060.00914.94
7.3.330.0000.00513.54
7.3.320.0000.00613.41
7.3.310.0000.00716.68
7.3.300.0000.00716.66
7.3.290.0120.00316.68
7.3.280.0060.00916.66
7.3.270.0100.01317.40
7.3.260.0090.00818.24
7.3.250.0110.00716.79
7.3.240.0070.01116.97
7.3.230.0090.00916.84
7.3.210.0060.01316.66
7.3.200.0060.01019.39
7.3.190.0100.00716.69
7.3.180.0060.00916.48
7.3.170.0160.00016.54
7.3.160.0100.00616.73
7.3.120.0060.00914.91
7.3.10.0140.00416.83
7.3.00.0100.00516.72
7.2.330.0110.01116.87
7.2.320.0030.01717.12
7.2.310.0130.01017.15
7.2.300.0070.01116.74
7.2.290.0140.00617.01
7.2.130.0140.00416.96
7.2.120.0050.00916.96
7.2.110.0100.00317.12
7.2.100.0080.00817.16
7.2.90.0130.00316.89
7.2.80.0090.00616.96
7.2.70.0130.00817.18
7.2.60.0090.01017.17
7.2.50.0200.00517.05
7.2.40.0070.01017.15
7.2.30.0160.00716.90
7.2.20.0120.00817.06
7.2.10.0130.00816.96
7.2.00.0080.01018.05
7.1.250.0100.00515.74
7.1.200.0120.00315.90
7.1.100.0090.00317.93
7.1.70.0050.00217.50
7.1.60.0080.00317.19
7.1.50.0090.00317.14
7.1.40.0060.00616.77
7.1.30.0040.01116.84
7.1.20.0000.01616.86
7.1.10.0040.00416.86
7.1.00.0040.00416.84
7.0.200.0060.00316.85
7.0.190.0000.01016.97
7.0.180.0000.00916.44
7.0.170.0000.01216.50
7.0.160.0050.00516.54
7.0.150.0030.00616.44
7.0.140.0050.00316.58
7.0.130.0040.00416.73
7.0.120.0080.00316.61
7.0.110.0070.00316.66
7.0.100.0000.00716.44
7.0.90.0000.01016.50
7.0.80.0000.00716.59
7.0.70.0030.00816.50
7.0.60.0050.00516.44
7.0.50.0030.00616.54
7.0.40.0050.00216.44
7.0.30.0050.00516.44
7.0.20.0060.00916.44
7.0.10.0000.01616.44
7.0.00.0030.01216.44
5.6.300.0060.03920.99
5.6.290.0000.04520.96
5.6.280.0000.04421.06
5.6.270.0070.08421.08
5.6.260.0030.04921.02
5.6.250.0030.04320.89
5.6.240.0000.04420.93
5.6.230.0000.04520.98
5.6.220.0030.04021.00
5.6.210.0070.07821.18
5.6.200.0030.07220.89
5.6.190.0000.04921.10
5.6.180.0000.05021.10
5.6.170.0030.04420.88
5.6.160.0070.06721.01
5.6.150.0000.05220.95
5.6.140.0030.05021.09
5.6.130.0030.04121.03
5.6.120.0100.04021.09
5.6.110.0030.04120.98
5.6.100.0070.04120.97
5.6.90.0030.04420.99
5.6.80.0100.03320.54
5.6.70.0070.03720.54
5.6.60.0070.05120.50
5.6.50.0070.03720.24
5.6.40.0030.04220.37
5.6.30.0200.03320.46
5.6.20.0000.04820.52
5.6.10.0060.04220.33
5.6.00.0030.03920.36
5.5.380.0030.08017.61
5.5.370.0000.04317.65
5.5.360.0100.04917.68
5.5.350.0100.04617.63
5.5.340.0100.04217.96
5.5.330.0030.06017.95
5.5.320.0100.03218.21
5.5.310.0070.06917.95
5.5.300.0030.04018.24
5.5.290.0030.04217.95
5.5.280.0030.04217.99
5.5.270.0030.04417.95
5.5.260.0030.04118.14
5.5.250.0000.04818.06
5.5.240.0030.04617.34
5.5.230.0000.04617.64
5.5.220.0030.03917.61
5.5.210.0030.04117.63
5.5.200.0030.04017.67
5.5.190.0060.03517.63
5.5.180.0030.05717.60
5.5.160.0000.04217.50
5.5.150.0000.04217.59
5.5.140.0060.04217.59
5.5.130.0100.03217.50
5.5.120.0000.04017.59
5.5.110.0030.03817.30
5.5.100.0070.03917.48
5.5.90.0070.03617.50
5.5.80.0030.03917.46
5.5.70.0000.04017.49
5.5.60.0030.04017.45
5.5.50.0000.04317.25
5.5.40.0000.05117.46
5.5.30.0000.04417.20
5.5.20.0070.04417.55
5.5.10.0030.05317.49
5.5.00.0000.04017.50
5.4.450.0030.04219.62
5.4.440.0000.04719.60
5.4.430.0040.04619.59
5.4.420.0030.04319.36
5.4.410.0030.03719.42
5.4.400.0000.04219.19
5.4.390.0070.03719.28
5.4.380.0060.03419.20
5.4.370.0030.03819.30
5.4.360.0030.03819.27
5.4.350.0060.03419.27
5.4.340.0060.03919.13
5.4.320.0100.03319.12
5.4.310.0030.04019.31
5.4.300.0000.04219.13
5.4.290.0000.04019.25
5.4.280.0000.04719.30
5.4.270.0000.03919.27
5.4.260.0030.06119.29
5.4.250.0030.03819.18
5.4.240.0170.04119.23
5.4.230.0000.04619.35
5.4.220.0130.04719.30
5.4.210.0060.03419.25
5.4.200.0070.04719.26
5.4.190.0130.03219.19
5.4.180.0030.04019.28
5.4.170.0000.04019.11
5.4.160.0030.03919.30
5.4.150.0030.03819.11
5.4.140.0030.03416.65
5.4.130.0000.04016.78
5.4.120.0000.04716.77
5.4.110.0000.03816.70
5.4.100.0000.04316.61
5.4.90.0070.03116.84
5.4.80.0030.03416.82
5.4.70.0000.03716.82
5.4.60.0000.03616.67
5.4.50.0000.06916.88
5.4.40.0070.06016.73
5.4.30.0030.06516.59
5.4.20.0030.03716.81
5.4.10.0060.03216.88
5.4.00.0030.05716.44
5.3.290.0060.03416.44
5.3.280.0030.03916.44
5.3.270.0000.04116.44
5.3.260.0100.03116.44
5.3.250.0030.03516.44
5.3.240.0070.03216.44
5.3.230.0100.03616.44
5.3.220.0120.02816.44
5.3.210.0070.04316.44
5.3.200.0030.03916.44
5.3.190.0000.03816.44
5.3.180.0030.03516.44
5.3.170.0060.03516.44
5.3.160.0100.06416.44
5.3.150.0030.07616.44
5.3.140.0030.07816.44
5.3.130.0070.03516.44
5.3.120.0060.03416.44
5.3.110.0000.04916.44
5.3.100.0000.07216.44
5.3.90.0000.04116.44
5.3.80.0000.04916.44
5.3.70.0000.03816.44
5.3.60.0070.03116.44
5.3.50.0000.03716.44
5.3.40.0030.03416.44
5.3.30.0000.03816.44
5.3.20.0030.07116.44
5.3.10.0030.03616.44
5.3.00.0030.03716.44
5.2.170.0030.02916.44
5.2.160.0030.03016.44
5.2.150.0030.04916.44
5.2.140.0000.05816.44
5.2.130.0030.03616.44
5.2.120.0030.06416.44
5.2.110.0030.03016.44
5.2.100.0000.03216.44
5.2.90.0100.03016.44
5.2.80.0040.02816.44
5.2.70.0030.03116.44
5.2.60.0030.03716.44
5.2.50.0000.03116.44
5.2.40.0090.04416.44
5.2.30.0030.04616.44
5.2.20.0030.03316.44
5.2.10.0030.06316.44
5.2.00.0070.02516.44
5.1.60.0030.02316.44
5.1.50.0000.02616.44
5.1.40.0030.04216.44
5.1.30.0030.05616.44
5.1.20.0030.03816.44
5.1.10.0100.05216.44
5.1.00.0030.03616.44
5.0.50.0070.03516.44
5.0.40.0030.02916.44
5.0.30.0030.05716.44
5.0.20.0030.03716.44
5.0.10.0070.04116.44
5.0.00.0160.02616.44
4.4.90.0000.01816.44
4.4.80.0030.01316.44
4.4.70.0030.01316.44
4.4.60.0030.02116.44
4.4.50.0000.02716.44
4.4.40.0030.02416.44
4.4.30.0000.01616.44
4.4.20.0060.01216.44
4.4.10.0000.01916.44
4.4.00.0030.05116.44
4.3.110.0030.03516.44
4.3.100.0030.02916.44
4.3.90.0030.03416.44
4.3.80.0040.02516.44
4.3.70.0030.03516.44
4.3.60.0000.03916.44
4.3.50.0000.03016.44
4.3.40.0070.04316.44
4.3.30.0000.03916.44
4.3.20.0000.02816.44
4.3.10.0030.01816.44
4.3.00.0030.02716.44

preferences:
79.83 ms | 401 KiB | 5 Q