3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(bbc2html('[b]stuff[/b][youtube]abc[/youtube]')); function getYoutubeVideoID($id) { // Just a demo function return '!!'.$id.'!!'; } function bbc2html($content) { $search = '/\[(b|u|i)]([^\[]*)\[\/\1]/'; $replace = '<$1>$2</$1>'; $newContent = preg_replace($search, $replace, $content); return preg_replace_callback( '/\[youtube](.*?)\[\/youtube]/', static function ($matches) { return '<div class="video_wrapper card border-0 shadow text-center m-2" style="width: 25rem;"> <div class="video_trigger card-body" data-source="'.getYoutubeVideoID($matches[1]).'" data-type="youtube"> <p class="text-center">As soon as you click on the button you accept that cookies from YouTube to be loaded</p> <input type="button" class="btn btn-success" value="OK"> <a href="$2" type="button" target="_blank" class="btn btn-danger"><i class="fa-brands fa-youtube pe-1"></i>direct link</a> </div> <div class="video_layer" style="display: none;"> <iframe src="" border="0" data-scaling="true" data-format="16:9" style="height: 0px;"></iframe> </div> </div>'; }, $newContent ); }

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.30.0120.00619.61
8.5.20.0080.01019.41
8.5.10.0080.00920.24
8.5.00.0160.00720.15
8.4.180.0120.01119.77
8.4.170.0170.01119.92
8.4.160.0110.01023.83
8.4.150.0090.00416.97
8.4.140.0120.01017.68
8.4.130.0070.00318.76
8.4.120.0120.00823.99
8.4.110.0070.00318.88
8.4.100.0130.00818.73
8.4.90.0060.00318.83
8.4.80.0050.00418.62
8.4.70.0080.01218.07
8.4.60.0120.01018.60
8.4.50.0080.00720.58
8.4.40.0200.00019.46
8.4.30.0190.00020.64
8.4.20.0130.00726.03
8.4.10.0050.00523.89
8.3.300.0130.00918.50
8.3.290.0100.01118.52
8.3.280.0110.00918.70
8.3.270.0110.00916.70
8.3.260.0110.01016.84
8.3.250.0070.00718.96
8.3.240.0120.00717.18
8.3.230.0110.00816.50
8.3.220.0100.00818.94
8.3.210.0120.00916.81
8.3.200.0050.00416.61
8.3.190.0080.01117.24
8.3.180.0060.01217.05
8.3.170.0140.00420.88
8.3.160.0140.00416.97
8.3.150.0060.00916.82
8.3.140.0000.00917.31
8.3.130.0000.01518.66
8.3.120.0190.00019.07
8.3.110.0080.00420.94
8.3.100.0090.00624.06
8.3.90.0060.00626.77
8.3.80.0040.00417.97
8.3.70.0040.01616.75
8.3.60.0060.00918.68
8.3.50.0070.01017.11
8.3.40.0070.01020.34
8.3.30.0160.00018.96
8.3.20.0040.00424.18
8.3.10.0000.00824.66
8.3.00.0080.00026.16
8.2.300.0120.00718.30
8.2.290.0120.00820.57
8.2.280.0120.00618.65
8.2.270.0110.00717.55
8.2.260.0130.00618.71
8.2.250.0000.00818.54
8.2.240.0060.00320.62
8.2.230.0040.00422.58
8.2.220.0040.00437.54
8.2.210.0080.00026.77
8.2.200.0040.00718.54
8.2.190.0130.01016.88
8.2.180.0090.00616.75
8.2.170.0140.00719.10
8.2.160.0070.00722.96
8.2.150.0070.00325.66
8.2.140.0000.00724.66
8.2.130.0040.00426.16
8.2.120.0040.00426.16
8.2.110.0060.00321.09
8.2.100.0120.00317.91
8.2.90.0040.00418.00
8.2.80.0040.00417.97
8.2.70.0090.00017.80
8.2.60.0000.00819.46
8.2.50.0030.00618.10
8.2.40.0030.00620.55
8.2.30.0040.00418.23
8.2.20.0030.00619.29
8.2.10.0100.00717.93
8.2.00.0110.00617.89
8.1.340.0100.01017.78
8.1.330.0100.00821.99
8.1.320.0180.01116.12
8.1.310.0080.00018.45
8.1.300.0060.00318.27
8.1.290.0090.00030.84
8.1.280.0150.00425.92
8.1.270.0080.00024.66
8.1.260.0030.00526.35
8.1.250.0030.00728.09
8.1.240.0080.00317.60
8.1.230.0060.00617.84
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0100.00017.50
8.1.190.0000.00817.35
8.1.180.0060.00318.10
8.1.170.0000.00818.68
8.1.160.0050.00218.96
8.1.150.0040.00418.80
8.1.140.0120.00417.50
8.1.130.0060.00617.61
8.1.120.0090.00717.64
8.1.110.0140.00317.57
8.1.100.0140.00317.57
8.1.90.0100.00517.74
8.1.80.0030.01317.57
8.1.70.0110.00517.75
8.1.60.0160.00317.71
8.1.50.0120.00617.66
8.1.40.0090.01317.82
8.1.30.0200.00017.84
8.1.20.0150.00517.79
8.1.10.0100.01017.75
8.1.00.0120.00817.61
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0000.00718.49
8.0.270.0160.00016.89
8.0.260.0140.00316.97
8.0.250.0090.00516.97
8.0.240.0110.00417.02
8.0.230.0040.01117.11
8.0.220.0100.00316.98
8.0.210.0100.00516.89
8.0.200.0120.00317.05
8.0.190.0000.01516.95
8.0.180.0100.00517.03
8.0.170.0090.00516.81
8.0.160.0150.00417.03
8.0.150.0070.00717.02
8.0.140.0100.00716.90
8.0.130.0080.00817.04
8.0.120.0140.00316.89
8.0.110.0120.00616.98
8.0.100.0120.00316.97
8.0.90.0130.00216.89
8.0.80.0100.00516.95
8.0.70.0050.01017.09
8.0.60.0140.00316.82
8.0.50.0100.00516.99
8.0.30.0130.00416.98
8.0.20.0090.00917.00
8.0.10.0090.00617.11

preferences:
91.71 ms | 1217 KiB | 5 Q