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. Extract the URLs $re = '|<a((?!href)(?!<).)+?href=%([^%]+?)%((?!</a>).)+?</a>|'; $URLs = array(); preg_match_all($re, $matches[1], $URLs); echo('URLs='); print_r($URLs[2]);

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.0070.00718.55
8.3.50.0110.00822.27
8.3.40.0160.00018.93
8.3.30.0040.01119.09
8.3.20.0040.00420.34
8.3.10.0060.00321.73
8.3.00.0090.00019.28
8.2.180.0040.01118.40
8.2.170.0150.00022.96
8.2.160.0000.01420.37
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0060.00319.48
8.2.110.0070.00720.53
8.2.100.0070.00717.88
8.2.90.0040.00418.09
8.2.80.0050.00317.97
8.2.70.0040.00417.88
8.2.60.0000.00818.05
8.2.50.0050.00318.07
8.2.40.0070.00518.07
8.2.30.0040.00418.22
8.2.20.0000.00717.78
8.2.10.0050.00318.15
8.2.00.0050.00317.72
8.1.280.0070.01125.92
8.1.270.0060.00320.60
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00623.80
8.1.230.0110.00017.48
8.1.220.0060.00317.74
8.1.210.0030.00518.77
8.1.200.0040.00417.48
8.1.190.0090.00017.36
8.1.180.0000.00818.10
8.1.170.0030.00520.37
8.1.160.0080.00022.09
8.1.150.0000.00718.86
8.1.140.0030.00517.70
8.1.130.0080.00017.73
8.1.120.0000.00717.64
8.1.110.0000.00717.61
8.1.100.0040.00417.49
8.1.90.0070.00017.62
8.1.80.0040.00417.60
8.1.70.0030.00317.66
8.1.60.0030.00617.64
8.1.50.0060.00317.70
8.1.40.0030.00517.71
8.1.30.0040.00417.71
8.1.20.0040.00417.73
8.1.10.0000.00817.73
8.1.00.0000.00817.54
8.0.300.0040.00418.77
8.0.290.0030.00616.75
8.0.280.0000.00718.50
8.0.270.0000.00717.29
8.0.260.0040.00417.29
8.0.250.0030.00317.14
8.0.240.0030.00317.13
8.0.230.0070.00017.04
8.0.220.0000.00817.04
8.0.210.0040.00417.01
8.0.200.0080.00017.11
8.0.190.0000.00717.08
8.0.180.0040.00417.04
8.0.170.0000.00817.01
8.0.160.0000.00717.10
8.0.150.0040.00417.03
8.0.140.0000.00816.96
8.0.130.0050.00013.48
8.0.120.0040.00417.00
8.0.110.0040.00417.05
8.0.100.0030.00516.89
8.0.90.0070.00017.12
8.0.80.0140.00317.04
8.0.70.0070.00017.05
8.0.60.0080.00017.11
8.0.50.0040.00416.96
8.0.30.0150.01117.28
8.0.20.0080.01117.40
8.0.10.0050.00317.04
8.0.00.0080.01016.92
7.4.330.0000.00515.05
7.4.320.0000.00816.77
7.4.300.0000.00716.74
7.4.290.0030.00316.65
7.4.280.0040.00416.79
7.4.270.0030.00316.72
7.4.260.0030.00316.82
7.4.250.0030.00616.72
7.4.240.0040.00416.72
7.4.230.0040.00416.94
7.4.220.0070.01716.80
7.4.210.0100.00616.92
7.4.200.0000.00716.63
7.4.160.0120.00416.55
7.4.150.0170.00317.40
7.4.140.0110.00717.86
7.4.130.0080.01016.57
7.4.120.0090.01116.63
7.4.110.0060.01216.75
7.4.100.0070.01116.70
7.4.90.0070.01016.48
7.4.80.0150.00719.39
7.4.70.0130.00316.61
7.4.60.0080.00916.70
7.4.50.0000.00416.67
7.4.40.0130.01016.68
7.4.30.0100.01316.71
7.4.00.0070.00315.10
7.3.330.0050.00013.17
7.3.320.0140.00013.15
7.3.310.0000.00716.28
7.3.300.0030.00316.42
7.3.290.0060.01016.35
7.3.280.0100.01116.36
7.3.270.0040.01417.40
7.3.260.0130.00416.45
7.3.250.0160.00416.53
7.3.240.0080.01116.67
7.3.230.0110.00816.46
7.3.210.0040.01316.44
7.3.200.0170.01319.39
7.3.190.0120.00416.63
7.3.180.0060.00916.86
7.3.170.0090.00916.53
7.3.160.0060.01016.40
7.3.10.0070.00716.67
7.3.00.0110.00016.89
7.2.330.0080.01116.71
7.2.320.0060.01216.85
7.2.310.0100.00716.83
7.2.300.0110.00516.84
7.2.290.0090.00916.67
7.2.130.0070.01117.11
7.2.120.0060.00617.13
7.2.110.0050.01116.95
7.2.100.0120.00417.02
7.2.90.0100.00616.92
7.2.80.0060.00816.91
7.2.70.0090.00617.06
7.2.60.0110.00517.09
7.2.50.0110.00517.08
7.2.40.0060.00816.99
7.2.30.0170.00817.17
7.2.20.0100.00517.02
7.2.10.0130.00317.05
7.2.00.0060.01417.89
7.1.250.0030.00615.97
7.1.230.0420.00716.12
7.1.220.0100.00715.83
7.1.210.0100.00516.10
7.1.200.0060.00515.76
7.1.190.0040.01315.70
7.1.180.0220.00316.06
7.1.170.0090.00615.80
7.1.160.0160.00015.98
7.1.150.0120.00615.92
7.1.140.0090.00315.77
7.1.130.0120.00315.77
7.1.120.0160.00015.74
7.1.110.0160.00015.92
7.1.100.0040.01117.00
7.1.90.0200.00416.03
7.1.80.0180.00316.14
7.1.70.0020.01116.46
7.1.60.0160.00817.82
7.1.50.0120.01216.48
7.1.40.0140.00516.18
7.1.30.0080.01016.11
7.1.20.0080.01216.01
7.1.10.0150.00715.95
7.1.00.0110.03819.12
7.0.310.0170.00715.38
7.0.300.0130.00015.50
7.0.290.0030.01215.32
7.0.280.0100.00715.17
7.0.270.0030.01015.62
7.0.260.0000.01715.59
7.0.250.0120.00615.66
7.0.240.0090.00615.64
7.0.230.0180.00615.39
7.0.220.0150.00715.68
7.0.210.0110.00515.45
7.0.200.0150.00415.19
7.0.190.0080.00815.57
7.0.180.0120.00315.48
7.0.170.0150.00015.67
7.0.160.0110.00415.51
7.0.150.0160.00315.45
7.0.140.0280.03318.80
7.0.130.0210.00415.53
7.0.120.0070.00515.61
7.0.110.0110.00615.59
7.0.100.0130.00315.62
7.0.90.0190.00615.36
7.0.80.0110.00315.63
7.0.70.0160.00015.59
7.0.60.0070.04317.57
7.0.50.0060.04616.72
7.0.40.0100.04717.08
7.0.30.0150.02317.00
7.0.20.0190.03216.69
7.0.10.0200.03616.92
7.0.00.0090.03016.90
5.6.380.0100.00314.09
5.6.370.0110.00314.36
5.6.360.0070.00714.21
5.6.350.0110.00414.29
5.6.340.0150.00014.32
5.6.330.0110.00514.38
5.6.320.0100.00614.28
5.6.310.0150.00014.18
5.6.300.0090.00414.58
5.6.290.0140.00514.46
5.6.280.0050.04217.61
5.6.270.0060.00614.42
5.6.260.0160.00314.26
5.6.250.0060.01214.37
5.6.240.0100.00714.70
5.6.230.0060.00914.56
5.6.220.0090.00714.21
5.6.210.0150.01717.31
5.6.200.0070.04416.43
5.6.190.0110.04517.67
5.6.180.0180.02817.65
5.6.170.0210.04417.54
5.6.160.0100.03817.64
5.6.150.0070.02316.25
5.6.140.0080.04816.32
5.6.130.0060.02316.28
5.6.120.0090.02017.82
5.6.110.0080.02117.68
5.6.100.0170.03717.75
5.6.90.0060.04517.65
5.6.80.0100.02517.37
5.6.70.0140.04317.19
5.6.60.0140.00414.20
5.6.50.0140.00314.05
5.6.40.0170.00314.24
5.6.30.0130.00714.42
5.6.20.0050.01014.47
5.6.10.0100.00614.41
5.6.00.0070.01014.20
5.5.380.0070.01012.79
5.5.370.0090.00612.79
5.5.360.0150.00012.79
5.5.350.0100.03016.60
5.5.340.0080.02615.38
5.5.330.0020.02816.63
5.5.320.0100.02316.50
5.5.310.0210.03616.49
5.5.300.0070.01915.42
5.5.290.0050.04015.44
5.5.280.0070.04216.83
5.5.270.0060.04516.71
5.5.260.0070.02216.73
5.5.250.0150.03616.75
5.5.240.0210.02516.48
5.5.230.0070.00412.79
5.5.220.0100.00212.79
5.5.210.0110.00412.79
5.5.200.0120.00012.79
5.5.190.0070.00312.79
5.5.180.0080.00412.79
5.5.170.0040.01314.42
5.5.160.0040.01112.79
5.5.150.0090.00612.79
5.5.140.0050.00512.79
5.5.130.0120.00212.79
5.5.120.0100.00312.79
5.5.110.0110.00412.79
5.5.100.0100.00612.79
5.5.90.0150.00012.79
5.5.80.0120.00312.79
5.5.70.0080.00412.79
5.5.60.0130.00012.79
5.5.50.0060.00912.79
5.5.40.0060.00912.79
5.5.30.0100.00012.79
5.5.20.0040.00812.79
5.5.10.0030.00912.79
5.5.00.0110.00312.79
5.4.450.0090.03516.18
5.4.440.0380.03316.17
5.4.430.0450.03216.20
5.4.420.0580.03215.99
5.4.410.0120.03015.91
5.4.400.0180.02615.81
5.4.390.0150.03215.80
5.4.380.0130.03415.65
5.4.370.0160.02615.81
5.4.360.0170.02915.66
5.4.350.0210.02915.63
5.4.340.0140.03015.71
5.4.330.0100.00312.79
5.4.320.0200.02515.74
5.4.310.0110.03315.78
5.4.300.0080.03515.68
5.4.290.0170.02715.66
5.4.280.0150.02815.82
5.4.270.0150.03115.77
5.4.260.0110.03015.64
5.4.250.0180.02815.71
5.4.240.0140.03015.69
5.4.230.0170.02615.81
5.4.220.0160.02815.75
5.4.210.0130.03015.79
5.4.200.0120.02714.71
5.4.190.0120.02915.81
5.4.180.0220.02515.62
5.4.170.0170.03415.78
5.4.160.0160.02515.76
5.4.150.0170.02515.77
5.4.140.0100.03314.55
5.4.130.0130.03514.62
5.4.120.0070.04314.58
5.4.110.0160.02814.53
5.4.100.0100.03014.62
5.4.90.0150.02514.63
5.4.80.0080.03014.56
5.4.70.0130.02714.52
5.4.60.0110.02714.55
5.4.50.0110.02714.49
5.4.40.0120.03114.53
5.4.30.0100.02714.51
5.4.20.0140.02514.54
5.4.10.0120.02714.49
5.4.00.0140.02814.34
5.3.290.0180.02313.73
5.3.280.0140.02713.69
5.3.270.0080.03213.79
5.3.260.0130.02813.79
5.3.250.0140.02913.72
5.3.240.0180.03113.80
5.3.230.0100.02913.78
5.3.220.0230.03213.68
5.3.210.0170.02413.79
5.3.200.0090.03013.71
5.3.190.0130.03513.69
5.3.180.0110.03313.75
5.3.170.0090.03013.78
5.3.160.0140.03313.68
5.3.150.0140.02513.70
5.3.140.0110.03113.71
5.3.130.0050.03813.77
5.3.120.0170.02413.77
5.3.110.0220.02213.82
5.3.100.0150.02713.43
5.3.90.0120.02813.49
5.3.80.0110.02813.46
5.3.70.0100.03113.47
5.3.60.0120.02813.46
5.3.50.0090.03013.40
5.3.40.0130.02713.43
5.3.30.0160.02413.35
5.3.20.0120.02713.35
5.3.10.0160.02213.29
5.3.00.0140.02513.28
5.2.170.0120.01911.98
5.2.160.0040.02712.03
5.2.150.0050.02711.98
5.2.140.0100.02211.96
5.2.130.0070.02611.97
5.2.120.0100.02711.97
5.2.110.0130.01812.00
5.2.100.0100.02212.09
5.2.90.0100.02512.01
5.2.80.0080.02811.97
5.2.70.0100.02311.96
5.2.60.0050.02511.98
5.2.50.0130.02211.97
5.2.40.0120.02211.95
5.2.30.0110.02011.94
5.2.20.0140.01711.91
5.2.10.0090.03411.94
5.2.00.0070.02511.84
5.1.60.0100.01511.41
5.1.50.0100.01811.42
5.1.40.0080.02111.41
5.1.30.0060.02411.67
5.1.20.0110.01711.68
5.1.10.0070.01911.46
5.1.00.0100.01611.49
5.0.50.0080.01610.74
5.0.40.0050.01710.60
5.0.30.0080.02510.55
5.0.20.0020.02110.56
5.0.10.0050.01710.55
5.0.00.0030.02710.50
4.4.90.0000.0179.79
4.4.80.0030.0139.79
4.4.70.0030.0139.79
4.4.60.0070.0109.79
4.4.50.0070.0109.79
4.4.40.0070.0179.79
4.4.30.0000.0169.79
4.4.20.0020.0149.79
4.4.10.0090.0089.79
4.4.00.0030.0199.79
4.3.110.0040.0129.79
4.3.100.0080.0129.79
4.3.90.0070.0109.79
4.3.80.0050.0189.79
4.3.70.0070.0129.79
4.3.60.0060.0129.79
4.3.50.0020.0169.79
4.3.40.0040.0199.79
4.3.30.0020.0149.79
4.3.20.0050.0109.79
4.3.10.0050.0109.79
4.3.00.0030.0139.80

preferences:
47.13 ms | 401 KiB | 5 Q