3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <html> <head> <title>Urls</title> </head> <body> <a href="https://www.google.com">Google</a> <a href="https://facebook.com">Facebook</a> <a href="http://www.example.com">Example</a> <p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> <h1>Heading</h1> <a href="www.example.com">Example</a> </body> </html> HTML; $dom = new DOMDocument(); libxml_use_internal_errors(true); $dom->loadHTML($html); $xpath = new DOMXPath($dom); $result = []; foreach ($xpath->query("//@href") as $href) { $noQueryString = explode('?', $href->nodeValue, 2)[0]; if (strpos($noQueryString, 'www.example.com') !== false) { $result[] = $href->nodeValue; } } var_export($result);

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.00.0120.01020.43
8.4.150.0030.00014.05
8.4.140.0130.00817.89
8.4.130.0070.00117.96
8.4.120.0150.00520.96
8.4.110.0130.00822.59
8.4.100.0130.00818.42
8.4.90.0110.00921.23
8.4.80.0110.00919.21
8.4.70.0090.01018.33
8.4.60.0120.01019.02
8.4.50.0130.00818.96
8.4.40.0100.01018.01
8.4.30.0090.00922.57
8.4.20.0110.01118.32
8.4.10.0060.00317.86
8.3.280.0100.01018.79
8.3.270.0110.01016.86
8.3.260.0050.00416.98
8.3.250.0060.00319.59
8.3.240.0110.01017.01
8.3.230.0150.00616.97
8.3.220.0060.00219.60
8.3.210.0030.00517.24
8.3.200.0070.00217.17
8.3.190.0130.00617.34
8.3.180.0080.00417.59
8.3.170.0070.01121.00
8.3.160.0140.00417.46
8.3.150.0110.00717.45
8.3.140.0070.00718.79
8.3.130.0070.00317.14
8.3.120.0030.00619.02
8.3.110.0070.00320.94
8.3.100.0000.00817.12
8.3.90.0100.00026.77
8.3.80.0060.00316.75
8.3.70.0070.00718.68
8.3.60.0090.00918.93
8.3.50.0110.00824.68
8.3.40.0100.01322.36
8.3.30.0120.00319.15
8.3.20.0050.00224.18
8.3.10.0030.00524.66
8.3.00.0020.00526.16
8.2.290.0110.00820.65
8.2.280.0020.00618.69
8.2.270.0040.00417.54
8.2.260.0000.01516.83
8.2.250.0170.00318.74
8.2.240.0040.00717.36
8.2.230.0030.00622.58
8.2.220.0040.00424.06
8.2.210.0110.00726.77
8.2.200.0060.00317.25
8.2.190.0140.00717.13
8.2.180.0120.00625.92
8.2.170.0060.00919.40
8.2.160.0070.01122.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0080.00021.37
8.2.110.0100.00022.67
8.2.100.0040.00818.09
8.2.90.0030.00518.21
8.2.80.0060.00319.53
8.2.70.0060.00317.88
8.2.60.0040.00418.30
8.2.50.0040.00418.05
8.2.40.0000.00820.55
8.2.30.0040.00418.52
8.2.20.0000.00718.64
8.2.10.0040.00419.72
8.2.00.0030.00619.78
8.1.330.0100.00619.11
8.1.320.0090.01216.43
8.1.310.0030.01218.73
8.1.300.0160.00320.41
8.1.290.0060.00330.84
8.1.280.0000.01525.92
8.1.270.0000.01024.21
8.1.260.0060.00326.35
8.1.250.0050.00328.09
8.1.240.0060.00324.08
8.1.230.0060.00621.39
8.1.220.0000.00818.02
8.1.210.0030.00619.16
8.1.200.0050.00517.73
8.1.190.0040.00417.60
8.1.180.0030.00618.10
8.1.170.0040.00419.46
8.1.160.0000.00819.21
8.1.150.0100.00019.29
8.1.140.0040.00419.16
8.1.130.0040.00420.54
8.1.120.0030.00317.86
8.1.110.0000.00817.85
8.1.100.0040.00417.87
8.1.90.0050.00317.82
8.1.80.0000.00917.78
8.1.70.0030.00517.69
8.1.60.0090.00017.83
8.1.50.0040.00417.86
8.1.40.0040.00417.82
8.1.30.0060.00317.99
8.1.20.0040.00417.91
8.1.10.0040.00418.01
8.1.00.0030.00617.82
8.0.300.0000.00820.59
8.0.290.0080.00017.13
8.0.280.0030.00318.73
8.0.270.0050.00218.41
8.0.260.0060.00018.81
8.0.250.0000.00717.38
8.0.240.0040.00417.23
8.0.230.0030.00317.40
8.0.220.0000.00717.17
8.0.210.0040.00417.36
8.0.200.0000.00717.42
8.0.190.0030.00617.29
8.0.180.0000.00717.20
8.0.170.0090.00017.25
8.0.160.0070.00017.24
8.0.150.0070.00017.22
8.0.140.0040.00417.19
8.0.130.0000.00513.86
8.0.120.0000.00917.30
8.0.110.0050.00217.32
8.0.100.0050.00317.11
8.0.90.0000.00717.41
8.0.80.0050.01017.25
8.0.70.0080.00017.25
8.0.60.0050.00317.41
8.0.50.0000.00717.34
8.0.30.0130.00317.70
8.0.20.0120.00617.41
8.0.10.0000.00717.58
8.0.00.0130.00617.14
7.4.330.0020.00215.55
7.4.320.0040.00416.95
7.4.300.0060.00316.98
7.4.290.0070.00016.71
7.4.280.0030.00516.94
7.4.270.0030.00316.98
7.4.260.0060.00013.75
7.4.250.0040.00416.74
7.4.240.0070.00016.70
7.4.230.0070.00016.93
7.4.220.0000.00716.94
7.4.210.0070.00716.95
7.4.200.0040.00416.72
7.4.130.0030.01416.59
7.4.120.0060.01316.46
7.4.110.0190.00316.63
7.4.100.0100.00716.64
7.4.90.0080.00916.89
7.4.80.0030.01416.79
7.4.70.0080.01716.60
7.4.60.0120.00616.93
7.4.50.0060.01016.98
7.4.40.0150.00416.84
7.4.30.0030.01316.66
7.4.20.0060.01216.62
7.4.10.0060.01116.63
7.4.00.0040.01416.98
7.3.330.0070.00016.56
7.3.320.0050.00013.57
7.3.310.0030.00316.79
7.3.300.0030.00316.61
7.3.290.0090.00916.65
7.3.260.0100.01716.81
7.3.250.0100.00816.53
7.3.240.0090.00916.79
7.3.230.0100.01316.61
7.3.220.0100.00716.74
7.3.210.0100.00716.71
7.3.200.0110.00616.91
7.3.190.0120.00616.64
7.3.180.0100.00616.54
7.3.170.0170.00416.52
7.3.160.0130.01016.79
7.3.150.0020.01416.42
7.3.140.0070.01016.50
7.3.130.0110.00716.72
7.3.120.0120.00616.75
7.3.110.0130.00516.76
7.3.100.0090.00916.61
7.3.90.0050.01216.61
7.3.80.0160.00816.66
7.3.70.0120.00916.63
7.3.60.0000.01816.60
7.3.50.0100.01016.64
7.3.40.0120.01016.61
7.3.30.0130.00716.64
7.3.20.0040.01516.55
7.3.10.0030.01516.69
7.3.00.0130.00716.61

preferences:
31.17 ms | 403 KiB | 5 Q