3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('HAZELFENCES_WEBSITE', 'https://test.com'); $text = '[youtube]https://www.youtube.com/watch?v=xHLE2LTAItw&amp;t=53s[/youtube]'; $text .= '[youtube]https://www.youtube.com/watch?v=xHLE2LTAItw[/youtube]'; if (preg_match_all("/\[youtube\]((\s|.)+?)\[\/youtube\]/i", $text, $matches)) { $allMatches = count($matches[0]); if (is_array($matches[0]) && $allMatches > 0) { for ($i = 0; $i < $allMatches; $i++) { $text = str_replace("watch?v=", "embed/", $text); if (strpos($matches[0][$i], "&amp;t=") !== false) { $text = str_replace("&amp;t=", "?start=", $text); $text = preg_replace("#s\[\/youtube\]#i", "&enablejsapi=1&origin=". HAZELFENCES_WEBSITE ."[/youtube]", $text); } else { $text = preg_replace("#\[\/youtube\]#i", "?enablejsapi=1&origin=". HAZELFENCES_WEBSITE ."[/youtube]", $text); } } $text = preg_replace("/\[youtube\]((\s|.)+?)\[\/youtube\]/i", "<iframe width=\"640\" height=\"510\" src=\"\\1\" loading=\"lazy\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>", $text); } } echo $text; ?>

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.4.120.0100.01020.59
8.4.110.0120.00820.71
8.4.100.0120.00817.93
8.4.90.0140.00820.51
8.4.80.0090.00519.05
8.4.70.0040.00418.00
8.4.60.0130.00818.48
8.4.50.0160.00717.81
8.4.40.0040.00419.86
8.4.30.0030.00518.84
8.4.20.0170.00322.44
8.4.10.0140.00723.79
8.3.250.0080.01118.79
8.3.240.0130.00516.47
8.3.230.0120.00716.91
8.3.220.0110.00719.26
8.3.210.0150.00716.69
8.3.200.0030.00616.67
8.3.190.0110.00716.96
8.3.180.0070.00818.89
8.3.170.0090.00917.34
8.3.160.0000.01817.44
8.3.150.0000.01517.13
8.3.140.0060.01116.99
8.3.130.0070.01016.80
8.3.120.0040.00420.49
8.3.110.0000.00917.05
8.3.100.0000.00918.73
8.3.90.0060.00326.77
8.3.80.0060.00316.75
8.3.70.0180.00016.75
8.3.60.0100.01018.38
8.3.50.0100.00720.23
8.3.40.0040.01120.36
8.3.30.0120.00318.79
8.3.20.0060.00324.18
8.3.10.0080.00024.66
8.3.00.0040.00426.16
8.2.290.0110.00420.46
8.2.280.0120.00718.42
8.2.270.0070.00417.37
8.2.260.0120.00618.31
8.2.250.0040.00417.09
8.2.240.0120.00316.53
8.2.230.0030.00720.94
8.2.220.0060.00324.06
8.2.210.0150.00326.77
8.2.200.0100.00018.53
8.2.190.0040.01116.59
8.2.180.0090.00625.92
8.2.170.0090.01522.96
8.2.160.0040.01122.96
8.2.150.0050.00325.66
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0030.00620.89
8.2.110.0060.00322.32
8.2.100.0050.00517.91
8.2.90.0000.00819.17
8.2.80.0030.00517.97
8.2.70.0070.00417.75
8.2.60.0050.00317.93
8.2.50.0060.00318.07
8.2.40.0060.00318.35
8.2.30.0070.00318.10
8.2.20.0000.00719.42
8.2.10.0040.00418.11
8.2.00.0050.00219.39
8.1.330.0130.00821.98
8.1.320.0110.00916.61
8.1.310.0150.00318.50
8.1.300.0060.00320.26
8.1.290.0110.00430.84
8.1.280.0090.00625.92
8.1.270.0050.00324.66
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0040.00420.95
8.1.230.0040.00718.02
8.1.220.0000.00817.91
8.1.210.0000.00818.77
8.1.200.0060.00317.48
8.1.190.0030.00617.48
8.1.180.0050.00318.10
8.1.170.0030.00618.82
8.1.160.0000.00718.96
8.1.150.0000.00718.82
8.1.140.0050.00217.66
8.1.130.0000.00719.26
8.1.120.0040.00417.58
8.1.110.0050.01117.59
8.1.100.0000.01217.46
8.1.90.0080.00417.49
8.1.80.0120.00017.29
8.1.70.0120.00017.48
8.1.60.0060.00617.62
8.1.50.0030.00917.46
8.1.40.0090.00617.62
8.1.30.0110.00317.43
8.1.20.0100.00517.87
8.1.10.0130.00017.57
8.1.00.0090.00417.45
8.0.300.0040.00418.77
8.0.290.0060.00317.00
8.0.280.0040.00418.50
8.0.270.0030.00317.30
8.0.260.0040.00418.77
8.0.250.0030.00317.20
8.0.240.0110.00417.10
8.0.230.0070.00716.97
8.0.220.0090.00717.06
8.0.210.0160.00017.10
8.0.200.0000.01517.02
8.0.190.0120.00316.95
8.0.180.0110.00517.04
8.0.170.0140.00016.93
8.0.160.0100.00517.07
8.0.150.0120.00516.92
8.0.140.0100.00716.91
8.0.130.0080.00816.86
8.0.120.0050.01016.99
8.0.110.0040.01217.06
8.0.100.0120.00416.94
8.0.90.0070.00716.81
8.0.80.0050.00916.98
8.0.70.0090.00917.07
8.0.60.0100.00716.88
8.0.50.0160.00017.00
8.0.30.0080.00416.91
8.0.20.0150.00016.75
8.0.10.0130.00016.95
7.4.330.0050.00015.55
7.4.320.0110.00716.88
7.4.300.0120.00316.65
7.4.290.0120.00816.73
7.4.280.0100.00616.68
7.4.270.0110.00416.82
7.4.260.0120.00216.74
7.4.250.0100.00516.66
7.4.240.0070.00816.73
7.4.230.0160.00316.79
7.4.220.0130.00616.63
7.4.210.0090.00916.73
7.4.200.0230.00216.86
7.4.190.0100.00716.70
7.4.180.0130.00316.88
7.4.160.0130.00316.79
7.4.150.0050.01116.84
7.4.140.0150.00016.66
7.4.130.0140.00516.80
7.4.120.0110.00716.82
7.4.110.0150.00316.75
7.4.100.0130.00416.73
7.4.90.0160.00016.78
7.4.80.0080.00816.77
7.4.70.0120.00516.55
7.4.60.0080.00816.70
7.4.50.0050.01116.70
7.4.40.0180.00016.70
7.4.30.0160.00016.62
7.4.20.0090.00716.79
7.4.10.0160.00016.66
7.4.00.0110.00416.73

preferences:
303.14 ms | 403 KiB | 5 Q