3v4l.org

run code in 300+ PHP versions simultaneously
<?php $bbcodes = [ 'Look at this:https://www.example.com/example?ohyeah=sure#okay this is a raw link', 'No attibute bbcode url: [url]http://example.com/x1[/url]', 'A url with link and link text: [url=http://example.com/x2]x2[/url]', 'Image with "ignorable" text: [IMG=sumpthing.jpg]sumpthing[/IMG]', 'Image: [img=sumpinelse][/img]' ]; $search = array ( // ... '~\[url=((?:ht|f)tps?://[a-z\d.-]+\.[a-z]{2,3}/\S*?)](.*?)\[/url]~i', '~\[url]((?:ht|f)tps?://[a-z\d.-]+\.[a-z]{2,3}/\S*?)\[/url]~i', // ... '~\[img=(.*?)].*?\[/img]~i', // if you want the possibility of dot matching newlines, add s pattern modifier // ... '~(?:<a.*?</a>|<img.*?</img>)(*SKIP)(*FAIL)|\bhttps?://.+?(?=\s|$)~im' // mop up any remaining links that are not bbtagged ); $replace = array ( // ... '<a href="$1" target="_blank">$2</a>', '<a href="$1" target="_blank">$1</a>', // ... '<img src="$1"></img>', // ... '<a href="$0" target="_blank">$0</a>', ); var_export(preg_replace($search, $replace, $bbcodes));

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.5.10.0120.00716.90
8.5.00.0130.01420.15
8.4.150.0030.00014.05
8.4.140.0150.00617.46
8.4.130.0110.01118.13
8.4.120.0110.01020.51
8.4.110.0090.00822.79
8.4.100.0090.00517.59
8.4.90.0120.00918.67
8.4.80.0090.00917.87
8.4.70.0120.00818.06
8.4.60.0050.00418.57
8.4.50.0150.00619.61
8.4.40.0100.01019.79
8.4.30.0140.00717.90
8.4.20.0170.00320.28
8.4.10.0060.00317.75
8.3.280.0130.00818.45
8.3.270.0090.01016.64
8.3.260.0100.00816.72
8.3.250.0140.00518.84
8.3.240.0090.01216.51
8.3.230.0060.00316.85
8.3.220.0040.00417.06
8.3.210.0110.01116.71
8.3.200.0040.00516.61
8.3.190.0040.00416.98
8.3.180.0030.00516.68
8.3.170.0150.00317.08
8.3.160.0100.01018.35
8.3.150.0000.01920.37
8.3.140.0130.00316.88
8.3.130.0080.01218.50
8.3.120.0030.00719.00
8.3.110.0060.00320.94
8.3.100.0090.00324.06
8.3.90.0030.00726.77
8.3.80.0070.00417.97
8.3.70.0090.00616.75
8.3.60.0160.00318.43
8.3.50.0180.00218.28
8.3.40.0130.00918.85
8.3.30.0090.00918.66
8.3.20.0040.00419.26
8.3.10.0040.00423.48
8.3.00.0080.00020.75
8.2.290.0040.00720.75
8.2.280.0040.00418.49
8.2.270.0120.00317.50
8.2.260.0040.00418.84
8.2.250.0090.00016.87
8.2.240.0160.00317.07
8.2.230.0030.00622.58
8.2.220.0060.00337.54
8.2.210.0040.00426.77
8.2.200.0060.00318.66
8.2.190.0110.00716.63
8.2.180.0070.00718.53
8.2.170.0110.00422.96
8.2.160.0100.00722.19
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0000.00817.97
8.2.120.0000.00826.35
8.2.110.0090.00021.17
8.2.100.0090.00317.91
8.2.90.0000.00818.22
8.2.80.0000.00818.03
8.2.70.0060.00317.75
8.2.60.0050.00317.63
8.2.50.0040.00417.75
8.2.40.0080.00019.17
8.2.30.0040.00419.33
8.2.20.0070.00018.06
8.2.10.0050.00318.23
8.2.00.0030.00517.72
8.1.330.0110.00821.70
8.1.320.0150.00416.46
8.1.310.0110.00716.59
8.1.300.0110.00718.27
8.1.290.0090.00030.84
8.1.280.0040.01125.92
8.1.270.0050.00318.94
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00622.07
8.1.230.0060.00621.09
8.1.220.0000.00817.74
8.1.210.0030.00618.85
8.1.200.0030.00617.48
8.1.190.0090.00017.35
8.1.180.0040.00418.10
8.1.170.0040.00418.78
8.1.160.0000.00718.79
8.1.150.0030.00518.91
8.1.140.0040.00322.20
8.1.130.0040.00422.07
8.1.120.0000.00817.55
8.1.110.0040.00417.50
8.1.100.0070.00017.61
8.1.90.0000.00717.63
8.1.80.0080.00017.47
8.1.70.0000.00817.47
8.1.60.0040.00417.69
8.1.50.0030.00617.53
8.1.40.0080.00017.55
8.1.30.0030.00917.68
8.1.20.0000.00817.67
8.1.10.0030.00617.55
8.1.00.0040.00417.63
8.0.300.0000.00820.02
8.0.290.0060.00316.88
8.0.280.0070.00018.45
8.0.270.0030.00317.20
8.0.260.0050.00318.43
8.0.250.0000.00717.02
8.0.240.0040.00416.98
8.0.230.0030.00316.98
8.0.220.0080.00017.00
8.0.210.0070.00016.94
8.0.200.0090.00016.95
8.0.190.0040.00416.98
8.0.180.0020.00517.06
8.0.170.0030.00617.08
8.0.160.0040.00417.01
8.0.150.0000.00717.02
8.0.140.0030.00317.02
8.0.130.0050.00013.38
8.0.120.0040.00416.89
8.0.110.0000.00717.07
8.0.100.0040.00416.84
8.0.90.0060.00316.93
8.0.80.0100.01017.00
8.0.70.0000.00716.82
8.0.60.0040.00416.90
8.0.50.0030.00516.89
8.0.30.0150.00417.14
8.0.20.0120.00617.40
8.0.10.0000.00717.08
8.0.00.0150.00316.88
7.4.330.0030.00315.55
7.4.320.0000.00716.79
7.4.300.0000.00716.84
7.4.290.0000.00716.79
7.4.280.0040.00416.80
7.4.270.0080.00016.68
7.4.260.0030.00616.70
7.4.250.0040.00416.77
7.4.240.0000.00816.68
7.4.230.0050.00316.54
7.4.220.0080.00016.88
7.4.210.0070.01016.84
7.4.200.0080.00016.70
7.4.160.0090.00716.60
7.4.140.0120.00817.86
7.4.130.0070.01016.73
7.4.120.0110.01016.73
7.4.110.0120.00616.77
7.4.100.0030.01716.71
7.4.90.0090.00916.76
7.4.80.0100.01019.39
7.4.70.0090.00916.66
7.4.60.0070.01016.60
7.4.50.0060.00916.56
7.4.40.0060.01316.61
7.4.10.0180.00316.52
7.4.00.0100.00615.74
7.3.330.0000.00513.30
7.3.320.0050.00013.20
7.3.310.0030.00616.38
7.3.300.0000.00716.38
7.3.290.0000.00716.36
7.3.280.0040.01116.29
7.3.260.0060.01216.47
7.3.240.0080.01016.51
7.3.230.0070.01116.34
7.3.210.0130.00616.59
7.3.200.0050.01316.69
7.3.190.0090.00916.28
7.3.180.0100.00716.34
7.3.170.0100.01316.39
7.3.160.0060.00916.39
7.3.130.0170.00616.27
7.3.120.0100.00616.66
7.3.110.0160.00416.66
7.3.100.0110.00716.68
7.3.90.0090.00616.58
7.3.80.0090.00515.58
7.3.70.0100.00715.56
7.3.60.0040.01215.31
7.3.50.0080.01115.38
7.3.40.0140.00215.47
7.3.30.0110.00715.61
7.3.20.0060.01115.59
7.3.10.0100.00715.59
7.3.00.0080.01315.62
7.2.330.0070.01116.56
7.2.320.0100.01516.58
7.2.310.0090.01516.72
7.2.300.0100.00716.59
7.2.290.0100.01016.42
7.2.260.0150.00616.54
7.2.250.0200.00016.62
7.2.240.0000.01816.72
7.2.230.0060.01016.59
7.2.220.0030.01416.63
7.2.210.0060.01315.56
7.2.200.0070.01015.60
7.2.190.0090.00915.52
7.2.180.0050.01115.68
7.2.170.0080.00615.62
7.2.160.0090.00815.67
7.2.150.0450.00515.73
7.2.140.0080.01215.90
7.2.130.0160.01015.79
7.2.120.0150.00415.69
7.2.110.0350.00715.27
7.2.100.0150.00515.29
7.2.90.0120.00815.44
7.2.80.0120.00715.40
7.2.70.0320.00815.43
7.2.60.0350.00815.45
7.2.50.0110.00815.50
7.2.40.0140.00815.52
7.2.30.0230.00715.40
7.2.20.0400.00615.29
7.2.10.0140.01115.29
7.2.00.0090.01115.57
7.1.330.0110.00815.66
7.1.320.0090.00815.57
7.1.310.0150.00514.73
7.1.300.0160.00914.62
7.1.290.0120.00714.73
7.1.280.0120.00314.52
7.1.270.0070.01014.83
7.1.260.0170.00314.71
7.1.250.0080.00714.69
7.1.240.0180.00414.54
7.1.230.0150.00614.50
7.1.220.0350.01514.59
7.1.210.0220.00914.42
7.1.200.0170.01114.44
7.1.190.0170.00714.22
7.1.180.0460.00714.46
7.1.170.0120.00714.45
7.1.160.0270.00914.54
7.1.150.0140.00714.57
7.1.140.0120.01014.40
7.1.130.0120.00714.37
7.1.120.0200.00714.50
7.1.110.0110.00914.53
7.1.100.0140.00714.43
7.1.90.0130.01214.44
7.1.80.0090.01314.55
7.1.70.0370.00714.43
7.1.60.0200.00620.49
7.1.50.0180.01020.48
7.1.40.0170.00920.60
7.1.30.0290.01120.59
7.1.20.0380.00520.53
7.1.10.0150.00614.45
7.1.00.0080.01014.35
7.0.330.0140.00814.36
7.0.320.0190.00414.25
7.0.310.0120.00914.56
7.0.300.0140.01014.34
7.0.290.0140.00914.43
7.0.280.0140.00713.96
7.0.270.0190.00514.31
7.0.260.0190.00414.54
7.0.250.0080.01414.57
7.0.240.0100.01214.53
7.0.230.0150.01014.39
7.0.220.0170.00514.40
7.0.210.0160.00514.31
7.0.200.0230.01014.45
7.0.190.0110.01014.53
7.0.180.0110.01014.56
7.0.170.0120.01314.46
7.0.160.0160.00414.26
7.0.150.0170.00614.38
7.0.140.0130.00814.30
7.0.130.0150.00614.29
7.0.120.0130.00714.58
7.0.110.0110.01114.41
7.0.100.0130.00814.39
7.0.90.0160.00814.52
7.0.80.0070.01414.48
7.0.70.0120.01014.45
7.0.60.0160.00214.51
7.0.50.0120.01014.46
7.0.40.0170.00914.60
7.0.30.0180.00514.57
7.0.20.0150.00614.58
7.0.10.0150.00814.55
7.0.00.0180.00414.38
5.6.400.0090.01115.08
5.6.390.0120.00914.99
5.6.380.0110.00914.78
5.6.370.0120.00914.92
5.6.360.0150.00914.96
5.6.350.0100.01015.10
5.6.340.0100.01014.95
5.6.330.0110.01014.94
5.6.320.0070.01415.29
5.6.310.0090.01415.25
5.6.300.0120.01114.96
5.6.290.0110.01115.13
5.6.280.0110.01015.05
5.6.270.0170.00414.97
5.6.260.0180.00314.96
5.6.250.0080.01315.00
5.6.240.0090.01414.87
5.6.230.0150.00614.90
5.6.220.0170.00615.02
5.6.210.0170.00314.94
5.6.200.0070.01215.02
5.6.190.0100.01114.98
5.6.180.0110.01014.75
5.6.170.0070.01315.08
5.6.160.0180.00214.95
5.6.150.0070.01315.01
5.6.140.0100.01015.10
5.6.130.0110.01114.97
5.6.120.0120.00914.93
5.6.110.0140.00814.96
5.6.100.0130.00814.96
5.6.90.0120.01015.20
5.6.80.0130.00914.88
5.6.70.0120.00514.79
5.6.60.0050.01615.04
5.6.50.0140.00714.96
5.6.40.0100.01114.88
5.6.30.0100.01215.05
5.6.20.0120.00814.82
5.6.10.0120.00914.84
5.6.00.0150.00814.94
5.5.380.0090.01314.99
5.5.370.0110.01214.98
5.5.360.0140.00814.97
5.5.350.0120.00715.00
5.5.340.0160.00515.07
5.5.330.0090.01115.05
5.5.320.0150.00514.88
5.5.310.0150.00714.96
5.5.300.0140.00715.04
5.5.290.0090.01214.79
5.5.280.0130.00615.07
5.5.270.0080.01415.09
5.5.260.0100.01014.92
5.5.250.0090.01414.91
5.5.240.0120.00814.83
5.5.230.0130.00814.78
5.5.220.0100.01015.04
5.5.210.0090.01214.79
5.5.200.0130.00915.00
5.5.190.0130.00714.72
5.5.180.0100.01215.00
5.5.170.0100.01114.89
5.5.160.0060.01514.86
5.5.150.0120.00814.95
5.5.140.0090.01314.79
5.5.130.0080.01215.02
5.5.120.0140.00514.86
5.5.110.0150.00514.78
5.5.100.0060.01614.96
5.5.90.0180.00614.79
5.5.80.0090.01114.67
5.5.70.0120.01014.84
5.5.60.0110.01314.92
5.5.50.0110.00914.74
5.5.40.0150.00614.65
5.5.30.0160.00714.95
5.5.20.0170.00614.80
5.5.10.0100.01214.86
5.5.00.0160.00814.81
5.4.450.0110.00711.99
5.4.440.0070.00811.79
5.4.430.0140.00211.87
5.4.420.0120.00311.78
5.4.410.0120.00211.69
5.4.400.0110.00511.76
5.4.390.0060.00911.64
5.4.380.0080.00811.55
5.4.370.0100.00611.68
5.4.360.0090.00611.60
5.4.350.0100.00511.61
5.4.340.0110.00411.70
5.4.330.0080.00711.68
5.4.320.0080.00611.76
5.4.310.0100.00511.60
5.4.300.0100.00611.58
5.4.290.0080.00611.66
5.4.280.0050.00911.71
5.4.270.0090.00611.72
5.4.260.0080.00711.74
5.4.250.0100.00511.48
5.4.240.0090.00711.59
5.4.230.0120.00611.66
5.4.220.0100.00511.48
5.4.210.0070.00911.57
5.4.200.0110.00611.73
5.4.190.0110.00611.91
5.4.180.0140.00411.68
5.4.170.0080.00611.54
5.4.160.0170.00211.74
5.4.150.0030.01311.60
5.4.140.0070.00811.67
5.4.130.0070.00911.62
5.4.120.0060.00911.67
5.4.110.0110.00611.77
5.4.100.0100.00811.71
5.4.90.0110.00511.52
5.4.80.0090.00611.78
5.4.70.0110.00311.76
5.4.60.0120.00411.71
5.4.50.0040.01011.60
5.4.40.0100.00411.71
5.4.30.0120.00211.71
5.4.20.0080.00811.71
5.4.10.0100.00311.71
5.4.00.0090.00711.65
5.3.290.0080.00811.53
5.3.280.0110.00811.28
5.3.270.0100.00611.38
5.3.260.0080.00711.37
5.3.250.0120.00411.33
5.3.240.0120.00411.16
5.3.230.0050.00711.46
5.3.220.0070.00811.35
5.3.210.0100.00511.54
5.3.200.0100.00411.41
5.3.190.0100.00411.30
5.3.180.0060.00711.56
5.3.170.0050.00911.58
5.3.160.0070.00511.48
5.3.150.0120.00511.48
5.3.140.0100.00411.50
5.3.130.0130.00311.51
5.3.120.0080.00611.38
5.3.110.0120.00211.53
5.3.100.0080.00811.46
5.3.90.0080.00611.57
5.3.80.0090.00611.24
5.3.70.0100.00411.43
5.3.60.0090.00711.44
5.3.50.0100.00311.35
5.3.40.0040.00911.42
5.3.30.0080.00611.41
5.3.20.0060.00811.37
5.3.10.0100.00311.14
5.3.00.0120.00411.19
5.2.170.0090.00110.61
5.2.160.0080.00410.61
5.2.150.0090.00210.61
5.2.140.0080.00510.61
5.2.130.0050.00710.61
5.2.120.0080.00510.61
5.2.110.0040.00610.61
5.2.100.0060.00810.61
5.2.90.0040.00910.61
5.2.80.0050.00610.61
5.2.70.0120.00010.61
5.2.60.0040.00710.61
5.2.50.0050.00810.61
5.2.40.0060.00510.61
5.2.30.0080.00510.61
5.2.20.0070.00610.61
5.2.10.0050.00510.61
5.2.00.0010.01010.61
5.1.60.0030.00710.61
5.1.50.0090.00010.61
5.1.40.0080.00310.61
5.1.30.0040.00710.61
5.1.20.0070.00410.61
5.1.10.0040.00710.61
5.1.00.0030.00610.61
5.0.50.0060.00310.61
5.0.40.0070.00510.61
5.0.30.0040.00510.61
5.0.20.0070.00310.61
5.0.10.0060.00410.61
5.0.00.0050.00410.61
4.4.90.0040.00310.61
4.4.80.0020.00510.61
4.4.70.0030.00210.61
4.4.60.0040.00410.61
4.4.50.0010.00510.61
4.4.40.0030.00410.61
4.4.30.0050.00110.61
4.4.20.0020.00510.61
4.4.10.0010.00510.61
4.4.00.0010.00410.61
4.3.110.0020.00510.61
4.3.100.0060.00110.61
4.3.90.0000.00510.61
4.3.80.0020.00510.61
4.3.70.0050.00210.61
4.3.60.0000.00710.61
4.3.50.0070.00110.61
4.3.40.0050.00410.61
4.3.30.0040.00410.61
4.3.20.0030.00310.61
4.3.10.0040.00110.61
4.3.00.0030.00310.61

preferences:
189.65 ms | 403 KiB | 5 Q