3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = <<<HTML <a href="https://e...content-available-to-author-only...e.com/example1.jpg"> <a href="https://e...content-available-to-author-only...e.com/ストスト.jpg"> <a href="https://e...content-available-to-author-only...e.com/example3.jpg"> <a href="https://e...content-available-to-author-only...e.com/example3.bak"> HTML; $dom = new DomDocument(); $dom->loadHTML(mb_convert_encoding($input, 'HTML-ENTITIES', "UTF-8")); $anchors = $dom->getElementsByTagName("a"); $regex = '#^[\w,=/:.-]+\.(?:jpe?g|png|gif)$#iu'; foreach ($anchors as $anchor) { $res = $anchor->getAttribute("href"); if (preg_match($regex, $res)) { echo "Valid url: $res" . PHP_EOL; } else { echo "Invalid url: $res" . PHP_EOL; } }

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.0150.00718.14
8.4.130.0110.00918.36
8.4.120.0120.00820.83
8.4.110.0100.01022.92
8.4.100.0150.00619.02
8.4.90.0130.00819.21
8.4.80.0060.00518.30
8.4.70.0080.00618.32
8.4.60.0080.01319.02
8.4.50.0110.00920.35
8.4.40.0100.01018.21
8.4.30.0030.00619.03
8.4.20.0130.00718.34
8.4.10.0030.00619.01
8.3.270.0150.00817.12
8.3.260.0100.00917.39
8.3.250.0120.00719.09
8.3.240.0090.01217.29
8.3.230.0150.00417.35
8.3.220.0050.00317.45
8.3.210.0060.00217.22
8.3.200.0080.00317.11
8.3.190.0050.00417.24
8.3.180.0080.01120.91
8.3.170.0180.00017.28
8.3.160.0140.00617.28
8.3.150.0100.01017.42
8.3.140.0120.00319.37
8.3.130.0110.00017.30
8.3.120.0030.00621.15
8.3.110.0000.00819.07
8.3.100.0030.01316.93
8.3.90.0030.01626.77
8.3.80.0090.00017.11
8.3.70.0170.00718.88
8.3.60.0150.00619.06
8.3.50.0150.00623.86
8.3.40.0100.01319.24
8.3.30.0110.00419.21
8.3.20.0030.00622.96
8.3.10.0060.00320.53
8.3.00.0050.00321.02
8.2.290.0110.00820.59
8.2.280.0080.00618.85
8.2.270.0030.00617.12
8.2.260.0080.00019.18
8.2.250.0000.00817.57
8.2.240.0080.00819.08
8.2.230.0060.00320.94
8.2.220.0090.00024.06
8.2.210.0130.00626.77
8.2.200.0030.00617.00
8.2.190.0090.00617.00
8.2.180.0120.00318.69
8.2.170.0090.00622.96
8.2.160.0100.00320.64
8.2.150.0030.00624.18
8.2.140.0080.00024.66
8.2.130.0110.00726.16
8.2.120.0040.00420.20
8.2.110.0070.00321.32
8.2.100.0080.00418.41
8.2.90.0090.00018.52
8.2.80.0080.00018.30
8.2.70.0050.00518.41
8.2.60.0060.00318.59
8.2.50.0030.00519.70
8.2.40.0040.00421.56
8.2.30.0000.00719.74
8.2.20.0060.00318.53
8.2.10.0040.00419.71
8.2.00.0040.00419.70
8.1.330.0120.00722.29
8.1.320.0060.00516.66
8.1.310.0110.00717.14
8.1.300.0060.00318.32
8.1.290.0060.00318.88
8.1.280.0150.00625.92
8.1.270.0060.00322.24
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0060.00322.59
8.1.230.0060.00622.80
8.1.220.0040.00418.16
8.1.210.0040.00419.07
8.1.200.0080.00017.85
8.1.190.0000.01017.73
8.1.180.0000.00819.17
8.1.170.0060.00318.93
8.1.160.0040.00419.34
8.1.150.0060.00319.30
8.1.140.0040.00419.23
8.1.130.0030.00320.43
8.1.120.0050.00317.94
8.1.110.0040.00417.91
8.1.100.0060.00317.96
8.1.90.0040.00417.94
8.1.80.0080.00017.95
8.1.70.0000.00717.92
8.1.60.0030.00518.06
8.1.50.0080.00017.95
8.1.40.0080.00017.98
8.1.30.0040.00418.17
8.1.20.0030.00517.96
8.1.10.0050.00317.98
8.1.00.0000.00817.99
8.0.300.0020.00520.14
8.0.290.0050.00317.38
8.0.280.0040.00418.91
8.0.270.0000.00717.41
8.0.260.0000.00620.41
8.0.250.0000.00817.50
8.0.240.0030.00317.48
8.0.230.0030.00417.62
8.0.220.0000.00917.54
8.0.210.0030.00317.41
8.0.200.0030.00317.59
8.0.190.0000.00817.65
8.0.180.0000.00817.56
8.0.170.0060.00317.64
8.0.160.0060.00317.58
8.0.150.0020.00517.55
8.0.140.0020.00517.52
8.0.130.0030.00314.00
8.0.120.0030.00617.54
8.0.110.0000.00817.60
8.0.100.0000.00717.57
8.0.90.0030.00617.48
8.0.80.0030.01317.59
8.0.70.0030.00517.56
8.0.60.0080.00017.61
8.0.50.0050.00217.45
8.0.30.0080.00817.74
8.0.20.0050.01517.63
8.0.10.0040.00417.38
8.0.00.0060.01317.27
7.4.330.0000.00515.55
7.4.320.0000.00717.18
7.4.300.0000.00817.03
7.4.290.0000.00817.29
7.4.280.0000.00717.09
7.4.270.0000.00716.95
7.4.260.0000.00613.97
7.4.250.0030.00317.03
7.4.240.0040.00417.13
7.4.230.0080.00017.13
7.4.220.0020.00517.17
7.4.210.0070.00817.14
7.4.200.0030.00316.89
7.4.130.0150.00317.13
7.4.120.0170.00017.16
7.4.110.0120.00917.23
7.4.100.0100.00717.04
7.4.90.0130.00317.04
7.4.80.0150.00619.39
7.4.70.0070.01317.16
7.4.60.0060.01117.09
7.4.50.0120.00317.11
7.4.40.0110.00617.18
7.4.30.0050.01016.98
7.4.20.0060.00917.13
7.4.10.0110.00417.04
7.4.00.0080.00817.14
7.3.330.0040.00316.77
7.3.320.0060.00013.77
7.3.310.0030.00316.79
7.3.300.0030.00316.93
7.3.290.0120.00416.90
7.3.280.0070.01416.98
7.3.260.0060.01316.94
7.3.240.0090.00916.97
7.3.230.0060.01217.06
7.3.210.0130.00316.97
7.3.200.0110.00916.91
7.3.190.0000.01617.04
7.3.180.0110.00516.82
7.3.170.0110.00616.87
7.3.160.0100.00716.92
7.3.150.0140.00016.93
7.3.140.0060.00916.96
7.3.130.0040.01117.02
7.3.120.0140.00316.85
7.3.110.0090.00616.92
7.3.100.0050.01016.88
7.3.90.0120.00916.73
7.3.80.0110.01116.91
7.3.70.0130.00316.81
7.3.60.0060.00916.86
7.3.50.0060.00916.90
7.3.40.0060.01317.00
7.3.30.0130.00716.93
7.3.20.0100.00716.89
7.3.10.0160.00316.84
7.3.00.0080.00816.93
7.2.330.0120.00617.08
7.2.320.0090.00917.15
7.2.310.0070.01017.39
7.2.300.0170.00317.18
7.2.290.0070.01016.95
7.2.280.0110.00417.04
7.2.270.0110.00416.95
7.2.260.0040.01216.92
7.2.250.0180.00317.21
7.2.240.0070.00817.21
7.2.230.0040.01617.13
7.2.220.0160.00616.92
7.2.210.0060.01617.11
7.2.200.0080.00817.10
7.2.190.0070.00716.98
7.2.180.0120.00917.15
7.2.170.0100.01017.12
7.2.160.0060.01517.14
7.2.150.0090.00917.07
7.2.140.0080.00817.11
7.2.130.0100.00617.20
7.2.120.0110.00617.05
7.2.110.0120.00417.15
7.2.100.0000.01517.12
7.2.90.0040.01217.13
7.2.80.0270.01517.08
7.2.70.0100.01317.19
7.2.60.0100.01317.11
7.2.50.0060.01717.16
7.2.40.0160.00417.30
7.2.30.0030.01317.22
7.2.20.0040.01217.14
7.2.10.0000.01617.00
7.2.00.0100.00617.02

preferences:
16.63 ms | 403 KiB | 5 Q