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"); } } */ $re = '|<a((?!href)(?!<).)+?href=%([^%]+?)%((?!</a>).)+?</a>|'; preg_match_all($re, $matches[1], $matches); print_r($matches);

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.40.0150.00318.73
8.3.30.0030.01219.07
8.3.20.0040.00420.31
8.3.10.0050.00321.63
8.3.00.0030.00519.63
8.2.170.0090.01222.96
8.2.160.0100.01020.35
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.01126.16
8.2.120.0040.00419.38
8.2.110.0040.00420.38
8.2.100.0060.00618.03
8.2.90.0040.00419.35
8.2.80.0030.00617.97
8.2.70.0030.00617.75
8.2.60.0040.00418.05
8.2.50.0000.00818.07
8.2.40.0040.00818.04
8.2.30.0040.00418.14
8.2.20.0040.00417.79
8.2.10.0000.00818.10
8.2.00.0000.00817.95
8.1.270.0090.00020.51
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0130.00923.78
8.1.230.0110.00020.93
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0040.00417.48
8.1.180.0080.00018.10
8.1.170.0000.00820.38
8.1.160.0000.00722.06
8.1.150.0030.00518.89
8.1.140.0000.00717.53
8.1.130.0070.00017.74
8.1.120.0000.00717.64
8.1.110.0000.00717.53
8.1.100.0000.00717.53
8.1.90.0000.00717.65
8.1.80.0050.00317.61
8.1.70.0040.00417.62
8.1.60.0080.00017.64
8.1.50.0060.00317.68
8.1.40.0030.00617.61
8.1.30.0000.00917.86
8.1.20.0020.00517.86
8.1.10.0040.00417.61
8.1.00.0080.00017.61
8.0.300.0040.00718.77
8.0.290.0000.00716.88
8.0.280.0070.00018.36
8.0.270.0040.00417.18
8.0.260.0030.00317.29
8.0.250.0000.00717.09
8.0.240.0000.00717.18
8.0.230.0070.00017.11
8.0.220.0070.00016.95
8.0.210.0080.00017.02
8.0.200.0000.00717.00
8.0.190.0050.00217.12
8.0.180.0040.00416.95
8.0.170.0050.00217.14
8.0.160.0000.00717.13
8.0.150.0000.00816.89
8.0.140.0000.00816.91
8.0.130.0060.00013.53
8.0.120.0040.00416.99
8.0.110.0000.00717.02
8.0.100.0040.00416.84
8.0.90.0040.00416.89
8.0.80.0060.01017.02
8.0.70.0060.00317.17
8.0.60.0050.00217.05
8.0.50.0040.00416.94
8.0.30.0120.01317.34
8.0.20.0100.01017.40
8.0.10.0000.00717.11
8.0.00.0130.00517.09
7.4.330.0060.00015.16
7.4.320.0000.00816.82
7.4.300.0000.00616.68
7.4.290.0040.00416.74
7.4.280.0060.00316.77
7.4.270.0030.00316.85
7.4.260.0040.00416.82
7.4.250.0000.00716.69
7.4.240.0020.00616.73
7.4.230.0000.00716.67
7.4.220.0200.00716.81
7.4.210.0090.01116.79
7.4.200.0070.00016.53
7.4.160.0070.01616.64
7.4.150.0090.00917.40
7.4.140.0110.00717.86
7.4.130.0150.00916.83
7.4.120.0040.01316.77
7.4.110.0120.00816.70
7.4.100.0090.00916.59
7.4.90.0080.01116.72
7.4.80.0100.01319.39
7.4.70.0040.01816.71
7.4.60.0080.00816.64
7.4.50.0000.00816.75
7.4.40.0110.01116.81
7.4.30.0200.00316.79
7.4.00.0000.01415.17
7.3.330.0050.00013.13
7.3.320.0090.00613.16
7.3.310.0030.00316.50
7.3.300.0000.00716.38
7.3.290.0050.01116.43
7.3.280.0090.00916.32
7.3.270.0140.01117.40
7.3.260.0140.00416.34
7.3.250.0110.00816.40
7.3.240.0100.00716.41
7.3.230.0120.01216.57
7.3.210.0080.00816.38
7.3.200.0140.00719.39
7.3.190.0080.00916.38
7.3.180.0030.01316.66
7.3.170.0130.00916.39
7.3.160.0060.01216.48
7.2.330.0140.00316.88
7.2.320.0140.00716.65
7.2.310.0120.01216.86
7.2.300.0080.00916.93
7.2.290.0090.01016.79
7.2.00.0030.01019.80
7.1.100.0110.00418.25
7.1.70.0030.00617.40
7.1.60.0100.01419.50
7.1.50.0080.01517.20
7.1.00.0070.06722.38
7.0.200.0100.01014.91
7.0.140.0070.06721.95
7.0.60.0030.07719.84
7.0.50.0100.07317.94
7.0.40.0170.06320.25
7.0.30.0170.04320.10
7.0.20.0330.07320.13
7.0.10.0370.05020.18
7.0.00.0100.07020.31
5.6.280.0100.06721.06
5.6.210.0070.03720.67
5.6.200.0070.04018.20
5.6.190.0100.08720.66
5.6.180.0330.06720.62
5.6.170.0300.05020.72
5.6.160.0100.08020.40
5.6.150.0030.06718.18
5.6.140.0030.04718.20
5.6.130.0130.03018.16
5.6.120.0070.04021.02
5.6.110.0030.06020.97
5.6.100.0030.07320.97
5.6.90.0130.05320.99
5.6.80.0100.08020.33
5.5.350.0170.07720.40
5.5.340.0130.07317.97
5.5.330.0130.04020.30
5.5.320.0170.03720.28
5.5.310.0330.07320.32
5.5.300.0000.05318.09
5.5.290.0100.07017.97
5.5.280.0200.05320.84
5.5.270.0100.07320.66
5.5.260.0070.05320.95
5.5.250.0070.08020.54
5.5.240.0070.08320.26
5.4.450.0670.05019.59
5.4.440.0970.05319.48
5.4.430.0600.06319.61
5.4.420.0200.04719.48
5.4.410.0830.06019.35
5.4.400.0370.04018.54
5.4.390.0230.05018.75
5.4.380.0170.05718.81
5.4.370.0270.04718.84
5.4.360.0200.05318.47
5.4.350.0200.05718.48
5.4.340.0230.05718.80
5.4.320.0270.04718.46
5.4.310.0230.05018.85
5.4.300.0070.06318.80
5.4.290.0300.04318.64
5.4.280.0300.04718.61
5.4.270.0200.05018.53
5.4.260.0100.06018.80
5.4.250.0130.06018.51
5.4.240.0100.06318.59
5.4.230.0200.05018.46
5.4.220.0200.05318.50
5.4.210.0170.05718.50
5.4.200.0270.04316.63
5.4.190.0270.04318.62
5.4.180.0200.05318.61
5.4.170.0230.05318.49
5.4.160.0170.05718.49
5.4.150.0300.06318.66
5.4.140.0230.05016.27
5.4.130.0200.04716.45
5.4.120.0200.04716.26
5.4.110.0170.05016.23
5.4.100.0270.05716.47
5.4.90.0200.05316.46
5.4.80.0300.04716.25
5.4.70.0270.04316.27
5.4.60.0230.04716.17
5.4.50.0370.05716.21
5.4.40.0200.05316.40
5.4.30.0130.05316.20
5.4.20.0200.06716.25
5.4.10.0270.04316.28
5.4.00.0200.05015.78
5.3.290.0230.06714.70
5.3.280.0300.05714.68
5.3.270.0170.06314.89
5.3.260.0300.04314.60
5.3.250.0200.05714.81
5.3.240.0230.06714.82
5.3.230.0200.05014.66
5.3.220.0130.05714.58
5.3.210.0330.05014.59
5.3.200.0170.05314.56
5.3.190.0170.06014.63
5.3.180.0130.06014.77
5.3.170.0230.04714.86
5.3.160.0070.06314.62
5.3.150.0300.04014.68
5.3.140.0170.05314.55
5.3.130.0170.06014.58
5.3.120.0200.05714.76
5.3.110.0200.05314.60
5.3.100.0200.05014.09
5.3.90.0100.05714.30
5.3.80.0130.05314.11
5.3.70.0230.04714.05
5.3.60.0200.05014.14
5.3.50.0230.05014.04
5.3.40.0230.04314.05
5.3.30.0200.05014.20
5.3.20.0300.04713.74
5.3.10.0270.04013.69
5.3.00.0170.05313.76
5.2.170.0130.04311.25
5.2.160.0100.04711.28
5.2.150.0100.04711.26
5.2.140.0130.04311.24
5.2.130.0100.04311.13
5.2.120.0130.04311.14
5.2.110.0200.03711.14
5.2.100.0230.05011.20
5.2.90.0200.03311.23
5.2.80.0270.04011.11
5.2.70.0130.04311.20
5.2.60.0200.03711.27
5.2.50.0170.04011.12
5.2.40.0100.04711.14
5.2.30.0130.04711.02
5.2.20.0170.03711.02
5.2.10.0030.05010.89
5.2.00.0130.04010.77
5.1.60.0100.03710.14
5.1.50.0070.04010.08
5.1.40.0230.02710.19
5.1.30.0130.03710.45
5.1.20.0170.03010.47
5.1.10.0070.04010.17
5.1.00.0070.03710.19
5.0.50.0030.0338.60
5.0.40.0100.0238.52
5.0.30.0070.0438.24
5.0.20.0070.0278.24
5.0.10.0100.0308.39
5.0.00.0070.0438.21
4.4.90.0100.0276.80
4.4.80.0100.0206.80
4.4.70.0070.0236.80
4.4.60.0070.0236.80
4.4.50.0070.0236.80
4.4.40.0030.0406.80
4.4.30.0030.0276.80
4.4.20.0130.0236.80
4.4.10.0130.0206.80
4.4.00.0100.0376.80
4.3.110.0030.0276.80
4.3.100.0030.0276.80
4.3.90.0170.0236.80
4.3.80.0030.0376.80
4.3.70.0100.0176.80
4.3.60.0030.0236.80
4.3.50.0100.0206.80
4.3.40.0030.0376.80
4.3.30.0030.0276.80
4.3.20.0130.0206.80
4.3.10.0000.0276.80
4.3.00.0100.0236.82

preferences:
47.23 ms | 400 KiB | 5 Q