3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 1. Identify the block of <a> elements $string = '<div><a href=%http://link1%><img></a><a href=%http://link2%><img></a><a href=%http://link3%><img></a></div>'; $re = '|<div>((<a((?!href)(?!<).)+?href=%([^%]+?)%((?!</a>).)+?</a>){3})</div>|'; $matches = array(); echo('result='.intval(preg_match($re, $string, $matches))."\n"); echo('$matches='); print_r($matches); // 2. Split it into individual <a> elements $re = '|(?<=</a>)(?=<a)|'; $pieces = preg_split($re, $matches[1]); echo('$pieces='); print_r($pieces); // 3. Analyze each <a> element, extract the interesting components $re = '|href=%([^%]*)%|'; foreach ($pieces as $a) { $matches = array(); if (preg_match($re, $a, $matches)) { echo($a.': '.$matches[1]."\n"); } }

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.0110.01118.56
8.3.50.0180.00322.25
8.3.40.0160.00318.98
8.3.30.0000.01519.07
8.3.20.0060.00320.34
8.3.10.0040.00421.85
8.3.00.0090.00019.41
8.2.180.0150.00418.31
8.2.170.0090.00622.96
8.2.160.0100.01020.35
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0070.01126.16
8.2.120.0000.00819.61
8.2.110.0030.00719.27
8.2.100.0120.00017.88
8.2.90.0000.00819.17
8.2.80.0040.00417.97
8.2.70.0030.00517.63
8.2.60.0050.00317.93
8.2.50.0030.00618.07
8.2.40.0060.00318.22
8.2.30.0000.00818.07
8.2.20.0000.00818.05
8.2.10.0030.00518.13
8.2.00.0000.00718.02
8.1.280.0180.00325.92
8.1.270.0060.00920.67
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0100.00024.05
8.1.230.0000.01217.61
8.1.220.0080.00017.91
8.1.210.0080.00318.77
8.1.200.0060.00317.61
8.1.190.0000.00917.47
8.1.180.0000.00918.10
8.1.170.0080.00020.30
8.1.160.0040.00422.13
8.1.150.0040.00418.90
8.1.140.0000.00817.65
8.1.130.0070.00017.80
8.1.120.0040.00417.57
8.1.110.0000.00817.71
8.1.100.0050.00217.65
8.1.90.0050.00317.68
8.1.80.0000.00817.68
8.1.70.0000.00717.63
8.1.60.0000.00917.77
8.1.50.0040.00417.71
8.1.40.0040.00417.70
8.1.30.0050.00317.89
8.1.20.0030.00617.69
8.1.10.0030.00517.84
8.1.00.0080.00017.73
8.0.300.0000.00718.77
8.0.290.0040.00417.00
8.0.280.0050.00318.42
8.0.270.0030.00317.32
8.0.260.0060.00017.34
8.0.250.0070.00017.13
8.0.240.0030.00317.21
8.0.230.0030.00317.10
8.0.220.0040.00417.04
8.0.210.0000.00717.19
8.0.200.0030.00317.25
8.0.190.0040.00417.25
8.0.180.0030.00517.19
8.0.170.0080.00017.08
8.0.160.0070.00017.11
8.0.150.0040.00417.15
8.0.140.0000.00817.05
8.0.130.0000.00713.50
8.0.120.0040.00417.16
8.0.110.0000.00817.17
8.0.100.0050.00317.20
8.0.90.0000.00717.06
8.0.80.0090.01317.12
8.0.70.0000.00816.93
8.0.60.0040.00417.00
8.0.50.0050.00316.98
8.0.30.0120.01217.20
8.0.20.0110.01117.40
8.0.10.0040.00417.16
8.0.00.0130.00716.86
7.4.330.0000.00615.17
7.4.320.0000.00716.90
7.4.300.0000.00716.83
7.4.290.0050.00316.89
7.4.280.0050.00316.77
7.4.270.0000.00716.77
7.4.260.0070.00016.89
7.4.250.0040.00416.58
7.4.240.0040.00416.79
7.4.230.0000.00716.96
7.4.220.0120.00616.82
7.4.210.0120.00916.73
7.4.200.0050.00216.92
7.4.160.0110.01116.76
7.4.150.0140.00417.40
7.4.140.0150.01017.86
7.4.130.0110.00716.72
7.4.120.0070.01016.79
7.4.110.0100.01316.65
7.4.100.0100.00716.64
7.4.90.0030.01516.79
7.4.80.0140.01319.39
7.4.70.0040.01616.96
7.4.60.0080.01016.74
7.4.50.0040.00016.82
7.4.40.0150.00416.67
7.4.30.0040.01516.84
7.4.00.0070.01014.88
7.3.330.0030.00313.40
7.3.320.0170.00013.33
7.3.310.0070.00016.52
7.3.300.0030.00316.49
7.3.290.0060.01016.52
7.3.280.0110.00616.54
7.3.270.0070.01117.40
7.3.260.0150.00316.62
7.3.250.0070.01116.82
7.3.240.0040.01416.96
7.3.230.0170.00016.76
7.3.210.0090.00916.54
7.3.200.0090.00919.39
7.3.190.0120.00616.73
7.3.180.0070.01016.66
7.3.170.0130.01016.62
7.3.160.0080.01016.90
7.2.330.0090.00916.95
7.2.320.0090.01216.99
7.2.310.0120.00916.95
7.2.300.0110.00716.93
7.2.290.0100.01316.88
7.2.00.0030.00919.81
7.1.100.0120.00317.94
7.1.70.0030.01017.43
7.1.60.0120.01219.50
7.1.50.0130.01017.22
7.1.00.0070.07022.32
7.0.200.0200.01015.06
7.0.140.0070.07321.98
7.0.60.0030.05720.03
7.0.50.0070.04017.91
7.0.40.0000.04720.16
7.0.30.0100.05020.26
7.0.20.0170.04320.25
7.0.10.0070.05320.30
7.0.00.0130.08320.07
5.6.280.0000.07721.04
5.6.210.0030.04020.47
5.6.200.0100.08018.25
5.6.190.0030.06020.68
5.6.180.0100.07720.34
5.6.170.0300.05720.57
5.6.160.0030.09020.53
5.6.150.0000.08718.13
5.6.140.0170.07018.12
5.6.130.0130.06718.25
5.6.120.0000.04721.15
5.6.110.0100.08021.11
5.6.100.0030.06720.89
5.6.90.0070.03721.03
5.6.80.0070.06020.53
5.5.350.4270.03720.41
5.5.340.0100.07718.09
5.5.330.0000.07720.57
5.5.320.0270.03720.52
5.5.310.0270.03720.51
5.5.300.0000.08317.93
5.5.290.0070.04017.98
5.5.280.0070.03720.68
5.5.270.0070.04020.87
5.5.260.0130.08320.79
5.5.250.0170.06720.55
5.5.240.0270.07020.16
5.4.450.0570.06319.63
5.4.440.0870.07319.48
5.4.430.0070.06019.17
5.4.420.0100.05719.54
5.4.410.0800.05719.34
5.4.400.0200.07018.77
5.4.390.0230.06718.44
5.4.380.0170.05718.47
5.4.370.0170.05318.62
5.4.360.0130.05718.62
5.4.350.0230.05018.77
5.4.340.0200.05318.81
5.4.320.0130.06018.84
5.4.310.0170.05318.51
5.4.300.0130.05718.72
5.4.290.0200.05018.79
5.4.280.0130.06318.63
5.4.270.0300.04318.46
5.4.260.0230.05018.46
5.4.250.0170.06018.84
5.4.240.0170.05718.62
5.4.230.0170.05718.77
5.4.220.0170.07018.74
5.4.210.0130.06018.74
5.4.200.0230.07016.57
5.4.190.0200.07318.62
5.4.180.0230.05018.50
5.4.170.0130.06018.51
5.4.160.0100.06018.67
5.4.150.0200.05718.67
5.4.140.0170.05716.21
5.4.130.0170.05016.30
5.4.120.0300.04016.29
5.4.110.0330.03716.25
5.4.100.0200.05316.20
5.4.90.0170.05316.20
5.4.80.0170.05316.25
5.4.70.0270.04316.15
5.4.60.0170.05716.42
5.4.50.0130.05316.30
5.4.40.0170.05316.26
5.4.30.0270.04316.18
5.4.20.0130.06016.23
5.4.10.0230.05716.18
5.4.00.0270.05015.66
5.3.290.0330.04714.77
5.3.280.0170.05314.66
5.3.270.0170.05714.59
5.3.260.0200.05314.66
5.3.250.0130.06014.60
5.3.240.0200.05014.70
5.3.230.0270.04314.78
5.3.220.0200.06014.61
5.3.210.0270.05014.77
5.3.200.0200.05014.78
5.3.190.0200.05314.62
5.3.180.0130.06314.60
5.3.170.0200.05314.72
5.3.160.0300.04714.62
5.3.150.0130.06314.77
5.3.140.0200.05714.85
5.3.130.0300.04314.76
5.3.120.0200.05314.59
5.3.110.0330.04314.61
5.3.100.0230.04714.18
5.3.90.0330.05014.20
5.3.80.0230.04714.04
5.3.70.0130.05714.13
5.3.60.0130.05314.02
5.3.50.0230.05014.07
5.3.40.0130.05714.06
5.3.30.0100.05713.89
5.3.20.0230.06313.72
5.3.10.0230.04013.71
5.3.00.0300.04713.74
5.2.170.0200.04311.16
5.2.160.0100.05011.13
5.2.150.0200.04311.23
5.2.140.0170.04311.26
5.2.130.0270.03711.11
5.2.120.0270.03311.24
5.2.110.0170.04311.21
5.2.100.0200.04011.09
5.2.90.0200.03711.10
5.2.80.0170.04311.15
5.2.70.0100.04711.11
5.2.60.0200.04711.25
5.2.50.0130.04311.00
5.2.40.0200.03311.12
5.2.30.0130.04311.11
5.2.20.0200.03711.07
5.2.10.0230.03010.84
5.2.00.0230.03010.82
5.1.60.0070.04010.04
5.1.50.0170.04310.11
5.1.40.0130.03710.01
5.1.30.0130.04010.56
5.1.20.0170.05310.49
5.1.10.0100.04010.21
5.1.00.0200.03310.17
5.0.50.0130.0378.64
5.0.40.0100.0378.55
5.0.30.0100.0538.37
5.0.20.0170.0308.24
5.0.10.0070.0308.23
5.0.00.0100.0408.22
4.4.90.0070.0236.80
4.4.80.0000.0306.80
4.4.70.0130.0206.80
4.4.60.0070.0206.80
4.4.50.0000.0306.80
4.4.40.0030.0506.80
4.4.30.0100.0276.80
4.4.20.0100.0276.80
4.4.10.0070.0306.80
4.4.00.0070.0436.80
4.3.110.0100.0276.80
4.3.100.0100.0236.80
4.3.90.0100.0206.80
4.3.80.0030.0376.80
4.3.70.0030.0236.80
4.3.60.0130.0206.80
4.3.50.0030.0236.80
4.3.40.0000.0406.80
4.3.30.0030.0236.80
4.3.20.0070.0206.80
4.3.10.0100.0176.80
4.3.00.0100.0207.12

preferences:
39.21 ms | 401 KiB | 5 Q