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.0110.00920.54
8.4.110.0120.00819.00
8.4.100.0080.01318.01
8.4.90.0170.00517.75
8.4.80.0050.00718.01
8.4.70.0120.00818.30
8.4.60.0120.00819.00
8.4.50.0140.00720.63
8.4.40.0040.01518.02
8.4.30.0110.00718.78
8.4.20.0030.00522.44
8.4.10.0060.00323.82
8.3.250.0140.00618.98
8.3.240.0060.00216.72
8.3.230.0060.00316.86
8.3.220.0040.00318.93
8.3.210.0070.01016.61
8.3.200.0140.00616.81
8.3.190.0100.00817.16
8.3.180.0130.00616.68
8.3.170.0070.01117.04
8.3.160.0040.01520.21
8.3.150.0120.00317.06
8.3.140.0110.00717.09
8.3.130.0040.00418.57
8.3.120.0060.00319.11
8.3.110.0060.00320.94
8.3.100.0060.00324.06
8.3.90.0030.00526.77
8.3.80.0060.00316.75
8.3.70.0040.01416.75
8.3.60.0070.00716.63
8.3.50.0070.00720.23
8.3.40.0060.00920.31
8.3.30.0040.01218.92
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0000.00826.16
8.2.290.0110.00820.53
8.2.280.0110.01018.61
8.2.270.0140.00717.05
8.2.260.0040.01418.57
8.2.250.0050.00318.55
8.2.240.0160.00318.90
8.2.230.0040.00422.58
8.2.220.0090.00037.54
8.2.210.0000.00826.77
8.2.200.0100.00018.79
8.2.190.0100.01316.88
8.2.180.0100.00725.92
8.2.170.0090.00618.99
8.2.160.0060.00922.96
8.2.150.0000.00825.66
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0000.00819.90
8.2.110.0060.00320.58
8.2.100.0090.00318.05
8.2.90.0040.00419.26
8.2.80.0050.00317.97
8.2.70.0030.00517.63
8.2.60.0080.00018.16
8.2.50.0060.00318.07
8.2.40.0040.00418.41
8.2.30.0050.00318.06
8.2.20.0040.00419.44
8.2.10.0040.00418.25
8.2.00.0000.00719.24
8.1.330.0100.01016.86
8.1.320.0120.00816.48
8.1.310.0000.00818.28
8.1.300.0000.00818.02
8.1.290.0060.00330.84
8.1.280.0030.01325.92
8.1.270.0040.00424.66
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0080.00023.97
8.1.230.0080.00417.55
8.1.220.0040.00417.91
8.1.210.0000.00818.77
8.1.200.0060.00317.60
8.1.190.0050.00317.47
8.1.180.0040.00818.10
8.1.170.0070.00718.51
8.1.160.0000.00818.82
8.1.150.0000.00818.87
8.1.140.0070.00017.69
8.1.130.0000.00718.85
8.1.120.0040.00417.56
8.1.110.0130.00417.59
8.1.100.0050.00517.62
8.1.90.0080.00317.52
8.1.80.0100.00017.47
8.1.70.0130.00017.51
8.1.60.0000.01217.61
8.1.50.0060.00617.70
8.1.40.0180.00017.59
8.1.30.0110.00817.89
8.1.20.0090.00917.73
8.1.10.0090.00917.78
8.1.00.0180.00017.65
8.0.300.0090.00018.77
8.0.290.0040.00417.00
8.0.280.0070.00018.38
8.0.270.0000.00717.23
8.0.260.0000.00718.55
8.0.250.0030.00317.05
8.0.240.0170.00017.13
8.0.230.0120.00017.02
8.0.220.0090.00316.93
8.0.210.0120.00017.03
8.0.200.0050.00717.12
8.0.190.0070.00517.05
8.0.180.0140.00017.02
8.0.170.0100.00617.09
8.0.160.0130.00317.11
8.0.150.0120.00316.90
8.0.140.0100.00517.07
8.0.130.0080.00617.04
8.0.120.0110.00416.96
8.0.110.0100.00716.86
8.0.100.0050.01416.96
8.0.90.0110.00616.98
8.0.80.0090.00716.81
8.0.70.0070.00816.96
8.0.60.0130.00317.08
8.0.50.0130.00516.97
8.0.30.0120.00717.12
8.0.20.0150.00417.03
8.0.10.0120.01117.05
7.4.330.0000.00515.55
7.4.320.0190.00416.88
7.4.300.0160.00316.86
7.4.290.0200.00016.72
7.4.280.0100.00916.79
7.4.270.0130.00516.83
7.4.260.0130.00716.62
7.4.250.0160.00416.77
7.4.240.0100.01016.80
7.4.230.0200.00016.86
7.4.220.0090.00716.65
7.4.210.0050.01116.84
7.4.200.0170.00016.82
7.4.190.0130.00316.92
7.4.180.0140.00316.89
7.4.160.0130.00516.70
7.4.150.0140.00316.80
7.4.140.0170.00016.83
7.4.130.0130.00516.67
7.4.120.0130.00316.75
7.4.110.0080.00816.68
7.4.100.0100.00716.71
7.4.90.0130.00516.73
7.4.80.0150.00316.76
7.4.70.0120.00616.66
7.4.60.0160.00216.72
7.4.50.0130.00516.61
7.4.40.0130.00616.52
7.4.30.0140.00416.78
7.4.20.0130.00316.70
7.4.10.0160.00016.61
7.4.00.0090.00916.42

preferences:
80.67 ms | 403 KiB | 5 Q