3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<'HTML' <html> <body> <a href="link.tld">Text<a> <a name="bla">Text<a> </body> </html> HTML; function urlHasString($url, $strings) { foreach($strings as $string) { if((FALSE !== strpos($url, $string))) { return false; } } return true; } function getAllLinks($html){ $dom = new DOMDocument(); if(@$dom->loadHTML($html)) { $xpath = new DOMXpath($dom); $anchors = $xpath->evaluate('//a[normalize-space(@href) != ""]'); foreach($anchors as $element) { $new_href =""; $href = $element->getAttribute('href'); $strings = array('#', 'java', 'jpg', 'jpeg', 'png', 'tel', 'pdf'); echo $href.": ".(urlHasString($href, $strings))."<br>"; } } return; } getAllLinks($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.4.140.0160.00617.68
8.4.130.0110.00919.73
8.4.120.0080.00724.51
8.4.110.0050.00619.39
8.4.100.0100.00518.25
8.4.90.0150.00620.85
8.4.80.0120.00719.30
8.4.70.0100.01019.36
8.4.60.0120.00820.87
8.4.50.0100.01018.91
8.4.40.0070.01319.56
8.4.30.0100.01017.87
8.4.20.0090.00318.14
8.4.10.0060.00318.11
8.3.270.0110.01116.85
8.3.260.0120.00817.02
8.3.250.0110.00719.22
8.3.240.0100.00819.25
8.3.230.0160.00316.92
8.3.220.0060.00219.29
8.3.210.0070.00818.64
8.3.200.0070.00216.97
8.3.190.0100.01017.52
8.3.180.0090.00721.41
8.3.170.0210.00017.22
8.3.160.0000.01817.13
8.3.150.0100.01017.25
8.3.140.0050.00318.54
8.3.130.0040.00416.99
8.3.120.0000.00919.44
8.3.110.0030.00517.15
8.3.100.0060.00318.68
8.3.90.0040.00418.85
8.3.80.0000.01017.97
8.3.70.0070.00717.00
8.3.60.0150.00417.13
8.3.50.0070.01122.18
8.3.40.0090.00618.92
8.3.30.0070.00719.22
8.3.20.0080.00019.40
8.3.10.0040.00422.01
8.3.00.0080.00020.04
8.2.290.0090.01017.30
8.2.280.0130.00718.66
8.2.270.0150.00316.74
8.2.260.0030.00617.35
8.2.250.0130.00317.12
8.2.240.0140.00417.24
8.2.230.0060.00320.94
8.2.220.0030.00637.54
8.2.210.0050.00326.77
8.2.200.0060.00317.00
8.2.190.0150.00016.88
8.2.180.0160.00318.41
8.2.170.0090.00619.24
8.2.160.0100.01022.96
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00421.17
8.2.110.0030.00621.25
8.2.100.0050.00518.18
8.2.90.0050.00319.42
8.2.80.0000.00817.97
8.2.70.0040.00418.00
8.2.60.0090.00018.18
8.2.50.0060.00318.07
8.2.40.0040.00421.47
8.2.30.0070.00021.13
8.2.20.0000.00918.04
8.2.10.0070.00018.44
8.2.00.0040.00418.42
8.1.330.0100.00616.18
8.1.320.0080.01316.55
8.1.310.0140.00016.94
8.1.300.0080.00016.49
8.1.290.0090.00018.88
8.1.280.0070.00725.92
8.1.270.0000.00724.16
8.1.260.0060.00326.35
8.1.250.0050.00228.09
8.1.240.0040.01819.38
8.1.230.0070.00418.16
8.1.220.0000.00818.16
8.1.210.0050.00318.77
8.1.200.0060.00317.72
8.1.190.0040.00417.91
8.1.180.0000.00818.10
8.1.170.0000.00918.96
8.1.160.0000.00722.40
8.1.150.0040.00419.33
8.1.140.0030.00619.89
8.1.130.0040.00418.01
8.1.120.0040.00417.89
8.1.110.0070.00017.63
8.1.100.0000.00817.83
8.1.90.0040.00417.86
8.1.80.0040.00417.84
8.1.70.0070.00017.85
8.1.60.0040.00418.01
8.1.50.0040.00417.87
8.1.40.0070.00317.87
8.1.30.0060.00318.06
8.1.20.0000.00817.84
8.1.10.0000.00717.96
8.1.00.0040.00417.91
8.0.300.0040.00418.77
8.0.290.0000.00717.13
8.0.280.0000.00718.84
8.0.270.0040.00417.59
8.0.260.0000.00617.59
8.0.250.0040.00417.43
8.0.240.0050.00317.40
8.0.230.0030.00317.38
8.0.220.0000.00717.19
8.0.210.0030.00317.21
8.0.200.0030.00317.27
8.0.190.0030.00717.25
8.0.180.0050.00317.24
8.0.170.0000.00817.41
8.0.160.0040.00417.43
8.0.150.0040.00417.36
8.0.140.0050.00217.20
8.0.130.0030.00313.75
8.0.120.0060.00317.30
8.0.110.0080.00017.36
8.0.100.0000.00717.27
8.0.90.0070.00017.45
8.0.80.0110.00817.29
8.0.70.0050.00317.29
8.0.60.0030.00617.24
8.0.50.0040.00417.21
8.0.30.0080.01117.42
8.0.20.0120.01017.61
8.0.10.0000.00717.37
8.0.00.0120.00616.88
7.4.330.0000.00715.24
7.4.320.0060.00016.91
7.4.300.0030.00316.73
7.4.290.0000.00716.98
7.4.280.0040.00416.89
7.4.270.0000.00716.91
7.4.260.0040.00416.99
7.4.250.0030.00316.84
7.4.240.0050.00216.93
7.4.230.0000.00716.84
7.4.220.0090.01616.86
7.4.210.0070.01016.97
7.4.200.0070.00016.97
7.4.160.0120.00316.81
7.4.150.0040.01417.40
7.4.140.0130.00817.86
7.4.130.0110.00816.76
7.4.120.0060.01216.87
7.4.110.0090.00917.06
7.4.100.0090.00916.84
7.4.90.0070.01117.16
7.4.80.0150.00919.39
7.4.70.0080.00916.79
7.4.60.0100.00716.67
7.4.50.0110.00717.13
7.4.40.0060.01316.98
7.4.30.0060.01117.03
7.4.00.0090.00715.28
7.3.330.0030.00513.57
7.3.320.0030.00313.55
7.3.310.0020.00516.62
7.3.300.0070.00016.70
7.3.290.0020.00516.69
7.3.280.0070.00716.70
7.3.270.0100.01117.40
7.3.260.0140.00816.75
7.3.250.0130.00616.86
7.3.240.0110.01116.80
7.3.230.0090.00916.96
7.3.210.0040.02116.63
7.3.200.0070.01019.39
7.3.190.0080.00817.04
7.3.180.0120.00316.85
7.3.170.0160.00616.93
7.3.160.0100.00716.71
7.3.120.0110.00614.90
7.3.110.0100.00615.10
7.3.100.0150.00315.21
7.3.90.0120.00315.11
7.3.80.0070.00715.03
7.3.70.0070.00715.02
7.3.60.0060.00615.13
7.3.50.0150.00015.12
7.3.40.0040.00814.70
7.3.30.0030.01014.79
7.3.20.0060.00916.90
7.3.10.0040.00716.87
7.3.00.0060.00316.67
7.2.330.0090.00916.89
7.2.320.0100.01017.09
7.2.310.0070.01117.03
7.2.300.0090.00916.98
7.2.290.0000.01817.14
7.2.250.0070.01315.19
7.2.240.0030.01415.27
7.2.230.0070.00715.36
7.2.220.0060.00915.45
7.2.210.0070.00315.44
7.2.200.0000.01615.36
7.2.190.0040.01114.94
7.2.180.0030.01315.20
7.2.170.0080.00815.09
7.2.60.0030.00917.16
7.2.00.0100.00319.84
7.1.330.0100.00715.96
7.1.320.0080.00516.02
7.1.310.0070.00715.98
7.1.300.0070.00316.23
7.1.290.0040.01215.68
7.1.280.0110.00315.97
7.1.270.0030.00615.68
7.1.260.0070.00715.80
7.1.200.0000.01315.89
7.1.100.0060.00618.05
7.1.70.0040.00417.10
7.1.60.0000.01519.85
7.1.00.0070.07322.46
7.0.200.0070.00017.12
7.0.60.0100.06019.93
7.0.50.0130.05720.51
7.0.40.0170.05720.45
7.0.30.0230.05020.46
7.0.20.0200.05720.54
7.0.10.0100.06320.51
7.0.00.0200.05720.53
5.6.280.0030.07021.09
5.6.210.0130.06320.71
5.6.200.0170.05321.31
5.6.190.0230.05321.19
5.6.180.0170.05721.34
5.6.170.0100.06321.22
5.6.160.0270.04721.25
5.6.150.0200.05321.34
5.6.140.0170.05321.20
5.6.130.0170.06021.28
5.6.120.0230.05021.25
5.6.110.0100.06721.23
5.6.100.0270.04321.32
5.6.90.0330.05721.04
5.6.80.0370.05320.62
5.6.70.0330.05320.46
5.6.60.0470.04720.57
5.6.50.0370.06320.72
5.6.40.0270.06320.66
5.6.30.0400.04720.67
5.6.20.0300.05720.68
5.6.10.0370.05320.63
5.6.00.0430.06320.60
5.5.350.0270.05020.70
5.5.340.0100.06020.94
5.5.330.0130.06021.13
5.5.320.0100.06020.99
5.5.310.0200.06321.01
5.5.300.0300.04321.05
5.5.290.0200.05320.99
5.5.280.0200.05021.02
5.5.270.0100.06320.99
5.5.260.0100.05720.95
5.5.250.0300.06320.66
5.5.240.0300.06020.52
5.5.230.0270.06320.44
5.5.220.0370.05020.37
5.5.210.0300.05720.44
5.5.200.0370.05720.32
5.5.190.0270.06320.21
5.5.180.0400.05020.50
5.5.160.0330.05720.39
5.5.150.0330.05720.41
5.5.140.0370.05320.31
5.5.130.0470.04320.30
5.5.120.0330.05720.44
5.5.110.0430.05020.21
5.5.100.0230.06720.40
5.5.90.0370.05020.26
5.5.80.0330.05320.30
5.5.70.0200.04320.32
5.5.60.0000.06320.18
5.5.50.0200.05020.26
5.5.40.0330.05320.23
5.5.30.0430.04320.25
5.5.20.0400.05020.36
5.5.10.0400.05020.17
5.5.00.0500.04020.18

preferences:
37.08 ms | 403 KiB | 5 Q