3v4l.org

run code in 300+ PHP versions simultaneously
<?php function GenerateAlbum($match) { return "<div class=\"album\>Do whatever: " . strtoupper($match[1]) . "</div>"; } function FormatModules($text) { $text = preg_replace_callback('~\[album\](.+?)\[/album\]~s', "GenerateAlbum", $text); $find = array( '~\[img width=(.*?) height=(.*?) alt=(.*?)\](https?://.*?\.(?:jpg|jpeg|gif|png))\[/img\]~s', '~\[youtube\](.+?)\[/youtube\]~s', '~\[vimeo\](.+?)\[/vimeo\]~s' ); $replace = array( '<img src="$4" width="$1" height="$2" alt="$3" />', '<iframe src="http://www.youtube.com/embed/$1"></iframe>', '<iframe src="https://player.vimeo.com/video/$1"></iframe>' ); return preg_replace($find, $replace, $text); } echo FormatModules("[vimeo]test1[/vimeo]\n\n[album]test2[/album]\n\njust text\n\n[img width=50 height=100 alt='sumpin good']http://www.example.com/image.gif[/img]\n\n[youtube]test3[/youtube]");

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.0110.00816.68
8.5.00.0140.00920.05
8.4.150.0020.00114.05
8.4.140.0140.00817.95
8.4.130.0040.00818.04
8.4.120.0060.01320.50
8.4.110.0060.00318.58
8.4.100.0150.00518.27
8.4.90.0050.00418.83
8.4.80.0060.00319.85
8.4.70.0120.00417.99
8.4.60.0080.01318.70
8.4.50.0060.00319.88
8.4.40.0070.00717.72
8.4.30.0040.01817.84
8.4.20.0030.01320.39
8.4.10.0060.00317.70
8.3.280.0120.00918.57
8.3.270.0100.01016.68
8.3.260.0100.00816.57
8.3.250.0090.00918.86
8.3.240.0170.00216.61
8.3.230.0140.00516.55
8.3.220.0110.00918.92
8.3.210.0030.00516.69
8.3.200.0050.00416.64
8.3.190.0100.00817.10
8.3.180.0070.00218.47
8.3.170.0060.00316.92
8.3.160.0040.00418.70
8.3.150.0100.01017.19
8.3.140.0090.00017.26
8.3.130.0060.01016.71
8.3.120.0000.00920.40
8.3.110.0060.00320.94
8.3.100.0040.00424.06
8.3.90.0040.00426.77
8.3.80.0030.00617.97
8.3.70.0070.01116.75
8.3.60.0150.00018.64
8.3.50.0110.00617.45
8.3.40.0060.01219.07
8.3.30.0100.01318.88
8.3.20.0000.00920.90
8.3.10.0040.00423.66
8.3.00.0000.00723.64
8.2.290.0050.00520.61
8.2.280.0130.00818.56
8.2.270.0170.00316.76
8.2.260.0100.01019.12
8.2.250.0080.00016.76
8.2.240.0060.00319.08
8.2.230.0000.00822.58
8.2.220.0090.00937.54
8.2.210.0080.00026.77
8.2.200.0090.00016.63
8.2.190.0040.01516.75
8.2.180.0070.00716.88
8.2.170.0000.01422.96
8.2.160.0070.00722.34
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00420.52
8.2.120.0030.00626.35
8.2.110.0110.00720.39
8.2.100.0120.00018.03
8.2.90.0040.00417.88
8.2.80.0000.00918.91
8.2.70.0050.00317.93
8.2.60.0040.00418.22
8.2.50.0040.00419.15
8.2.40.0000.00821.33
8.2.30.0000.00819.46
8.2.20.0000.00718.13
8.2.10.0070.00019.41
8.2.00.0000.00718.12
8.1.330.0130.00621.95
8.1.320.0170.00716.44
8.1.310.0070.00716.88
8.1.300.0100.00618.29
8.1.290.0030.00630.84
8.1.280.0130.00625.92
8.1.270.0080.00018.90
8.1.260.0060.00326.35
8.1.250.0080.00028.09
8.1.240.0060.00323.92
8.1.230.0040.00823.98
8.1.220.0040.00417.77
8.1.210.0050.00318.77
8.1.200.0060.00317.48
8.1.190.0050.00517.35
8.1.180.0050.00319.04
8.1.170.0030.00618.71
8.1.160.0000.00819.07
8.1.150.0000.00818.98
8.1.140.0040.00418.85
8.1.130.0060.00320.19
8.1.120.0040.00417.65
8.1.110.0040.00417.62
8.1.100.0040.00417.61
8.1.90.0040.00417.64
8.1.80.0050.00317.63
8.1.70.0060.00317.67
8.1.60.0000.00917.74
8.1.50.0000.00717.55
8.1.40.0030.00617.54
8.1.30.0000.00817.75
8.1.20.0030.00617.77
8.1.10.0000.00817.73
8.1.00.0040.00417.54
8.0.300.0000.00718.77
8.0.290.0050.00316.75
8.0.280.0050.00318.49
8.0.270.0000.00717.30
8.0.260.0030.00318.41
8.0.250.0040.00417.14
8.0.240.0040.00417.17
8.0.230.0000.00717.06
8.0.220.0000.00716.93
8.0.210.0030.00317.07
8.0.200.0000.00617.09
8.0.190.0080.00017.11
8.0.180.0000.00816.97
8.0.170.0040.00417.11
8.0.160.0070.00016.91
8.0.150.0040.00417.04
8.0.140.0030.00716.92
8.0.130.0000.00513.46
8.0.120.0060.00317.07
8.0.110.0040.00416.98
8.0.100.0000.00817.02
8.0.90.0040.00417.02
8.0.80.0070.00917.09
8.0.70.0070.00016.88
8.0.60.0040.00417.07
8.0.50.0000.00716.95
8.0.30.0080.01017.34
8.0.20.0250.01617.40
8.0.10.0040.00416.95
8.0.00.0130.00817.00
7.4.330.0000.00515.55
7.4.320.0070.00016.64
7.4.300.0000.00716.79
7.4.290.0080.00016.65
7.4.280.0060.00316.84
7.4.270.0000.00816.82
7.4.260.0070.00016.74
7.4.250.0040.00416.82
7.4.240.0030.00416.68
7.4.230.0080.00016.83
7.4.220.0000.00816.91
7.4.210.0070.00916.81
7.4.200.0040.00416.58
7.4.140.0100.00917.86
7.4.130.0070.01016.79
7.4.120.0100.01016.57
7.4.110.0070.01016.48
7.4.100.0090.00916.84
7.4.90.0150.00316.85
7.4.80.0220.00319.39
7.4.70.0070.01016.71
7.4.60.0060.01016.73
7.4.50.0000.01816.81
7.4.40.0000.01716.65
7.4.10.0110.00815.25
7.4.00.0090.01015.30
7.3.330.0000.00613.43
7.3.320.0000.00613.25
7.3.310.0030.00316.33
7.3.300.0070.00016.53
7.3.290.0000.00716.40
7.3.280.0050.00916.48
7.3.260.0130.00716.60
7.3.240.0110.00816.51
7.3.230.0060.01216.47
7.3.210.0130.00416.64
7.3.200.0130.00316.46
7.3.190.0150.00316.38
7.3.180.0170.00016.70
7.3.170.0090.00816.43
7.3.160.0060.01116.63
7.3.130.0110.00715.05
7.3.120.0100.01014.95
7.3.110.0100.00714.86
7.3.100.0120.00314.83
7.3.90.0060.01214.99
7.3.80.0040.00814.98
7.3.70.0100.00714.85
7.3.60.0000.01414.87
7.3.50.0000.01414.80
7.3.40.0070.00714.95
7.3.30.0000.01014.88
7.3.20.0060.00916.61
7.3.10.0470.00815.84
7.3.00.0460.00615.87
7.2.330.0040.01316.88
7.2.320.0130.00316.67
7.2.310.0070.01116.93
7.2.300.0070.01516.80
7.2.290.0080.00816.69
7.2.260.0070.01115.28
7.2.250.0060.01215.36
7.2.240.0000.01414.95
7.2.230.0060.00915.29
7.2.220.0060.00915.10
7.2.210.0000.00915.41
7.2.200.0100.00615.47
7.2.190.0120.00315.30
7.2.180.0070.00715.29
7.2.170.0000.01115.30
7.2.160.0060.00915.41
7.2.150.0000.01216.87
7.2.140.0070.00317.32
7.2.130.0410.00316.03
7.2.120.0310.00916.18
7.2.110.0320.00716.17
7.2.100.0410.00916.22
7.2.90.0290.01016.34
7.2.80.0260.01116.29
7.2.70.0460.00816.41
7.2.60.0350.00616.18
7.2.50.0340.01016.31
7.2.40.0330.00316.30
7.2.30.0330.00816.19
7.2.20.0580.00816.11
7.2.10.0840.01116.05
7.2.00.0440.00516.39
7.1.330.0030.00915.94
7.1.320.0000.01116.15
7.1.310.0000.01415.99
7.1.300.0000.01715.93
7.1.290.0070.00715.68
7.1.280.0060.00615.92
7.1.270.0100.00315.95
7.1.260.0000.01015.92
7.1.250.0350.00715.03
7.1.240.0120.00315.80
7.1.230.0060.00916.03
7.1.220.0080.00315.75
7.1.210.0060.00315.75
7.1.200.0150.00016.00
7.1.190.0030.01016.02
7.1.180.0080.00416.02
7.1.170.0040.01116.16
7.1.160.0040.00816.08
7.1.150.0060.00916.18
7.1.140.0080.00416.09
7.1.130.0090.00615.76
7.1.120.0000.01015.91
7.1.110.0100.00015.98
7.1.100.0030.00916.19
7.1.90.0030.00715.84
7.1.80.0090.00316.09
7.1.70.0030.00715.81
7.1.60.0000.00916.16
7.1.50.0000.01116.05
7.1.40.0000.01815.98
7.1.30.0080.00415.90
7.1.20.0000.00916.04
7.1.10.0030.01215.95
7.1.00.0070.00316.03

preferences:
41.38 ms | 403 KiB | 5 Q