3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "[img]http://www.test.com/ abc.jpg[/img]"; $uid = 123; $text = preg_replace_callback( "#\[img]((?:https?|ftps?)://[^?&=\#\"<]*?\.(?:jpe?g|gif|png))\[/img]#i", function ($m) use ($uid) { return "[img:$uid]" . str_replace(' ', '%20', $m[1]) . "[/img:$uid]"; }, $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.130.0110.00917.65
8.4.120.0040.00724.04
8.4.110.0030.00722.54
8.4.100.0070.00218.77
8.4.90.0090.01118.72
8.4.80.0130.00818.83
8.4.70.0050.00420.02
8.4.60.0140.00719.15
8.4.50.0080.00418.64
8.4.40.0150.00618.88
8.4.30.0090.01218.75
8.4.20.0030.01719.91
8.4.10.0100.00719.48
8.3.260.0100.00616.71
8.3.250.0110.00818.80
8.3.240.0080.01017.04
8.3.230.0090.01116.77
8.3.220.0100.00918.79
8.3.210.0040.00416.68
8.3.200.0050.00416.79
8.3.190.0090.00916.94
8.3.180.0170.00317.18
8.3.170.0080.00020.64
8.3.160.0060.01217.18
8.3.150.0120.00819.03
8.3.140.0030.00620.71
8.3.130.0060.00318.23
8.3.120.0030.00620.75
8.3.110.0100.00620.94
8.3.100.0030.00516.80
8.3.90.0110.00726.77
8.3.80.0030.00717.97
8.3.70.0060.00916.88
8.3.60.0540.00025.92
8.3.50.0190.00625.92
8.3.40.0340.01125.92
8.3.30.0260.00625.92
8.3.20.0350.00325.92
8.3.10.0250.00625.92
8.3.00.0290.00725.92
8.2.290.0100.00920.66
8.2.280.0100.00518.70
8.2.270.0110.00717.47
8.2.260.0110.00316.82
8.2.250.0120.00316.73
8.2.240.0040.00417.53
8.2.230.0040.00422.58
8.2.220.0060.00324.06
8.2.210.0070.01326.77
8.2.200.0050.00518.66
8.2.190.0030.01218.52
8.2.180.0230.00325.92
8.2.170.0350.00325.92
8.2.160.0150.00925.92
8.2.150.0270.00325.92
8.2.140.0260.00325.92
8.2.130.0200.01025.92
8.2.120.0160.01125.92
8.2.110.0230.00625.92
8.2.100.0220.01325.92
8.2.90.0230.00625.92
8.2.80.0210.00525.92
8.2.70.0230.00425.92
8.2.60.0200.01025.92
8.2.50.0260.00625.92
8.2.40.0190.00625.92
8.2.30.0210.00625.92
8.2.20.0180.00925.92
8.2.10.0220.00425.92
8.2.00.0260.00425.92
8.1.330.0100.00821.77
8.1.320.0130.00616.36
8.1.310.0120.00316.71
8.1.300.0030.00618.57
8.1.290.0060.00330.84
8.1.280.0170.00925.92
8.1.270.0200.01225.92
8.1.260.0200.01025.92
8.1.250.0230.00025.92
8.1.240.0190.01025.92
8.1.230.0210.00325.92
8.1.220.0120.01225.92
8.1.210.0170.01025.92
8.1.200.0140.00825.92
8.1.190.0180.00925.92
8.1.180.0270.00325.92
8.1.170.0230.00625.92
8.1.160.0210.00725.92
8.1.150.0320.00025.92
8.1.140.0150.01125.92
8.1.130.0200.00625.92
8.1.120.0200.00825.92
8.1.110.0360.00725.92
8.1.100.0190.01625.92
8.1.90.0210.00725.92
8.1.80.0220.00725.92
8.1.70.0190.00625.92
8.1.60.0260.00725.92
8.1.50.0220.00225.92
8.1.40.0170.01225.92
8.1.30.0260.00425.92
8.1.20.0190.01325.92
8.1.10.0260.00025.92
8.1.00.0310.00325.92

preferences:
33.9 ms | 403 KiB | 5 Q