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?)://[^\s?&=\#\"<]*?\.(?:jpe?g|gif|png))\[/img]#i", function ($m) use ($uid) { return "[img:$uid]" . $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.0060.00317.98
8.4.120.0130.00820.84
8.4.110.0110.00720.64
8.4.100.0110.00918.10
8.4.90.0150.00620.94
8.4.80.0100.00820.98
8.4.70.0100.00817.98
8.4.60.0120.01018.68
8.4.50.0120.01018.14
8.4.40.0110.00818.70
8.4.30.0080.00819.08
8.4.20.0100.01019.71
8.4.10.0080.00019.45
8.3.260.0110.00816.60
8.3.250.0110.00818.91
8.3.240.0100.00916.61
8.3.230.0110.00916.81
8.3.220.0110.00919.00
8.3.210.0110.00816.64
8.3.200.0100.00816.65
8.3.190.0090.00917.13
8.3.180.0050.00316.78
8.3.170.0160.00320.71
8.3.160.0080.00017.18
8.3.150.0060.00317.21
8.3.140.0040.01416.90
8.3.130.0030.00616.85
8.3.120.0000.00820.60
8.3.110.0080.00020.94
8.3.100.0060.00316.70
8.3.90.0000.00826.77
8.3.80.0040.00817.97
8.3.70.0060.00918.43
8.3.60.0410.01325.92
8.3.50.0200.00325.92
8.3.40.0350.01025.92
8.3.30.0280.01625.92
8.3.20.0340.01425.92
8.3.10.0370.00725.92
8.3.00.0320.02125.92
8.2.290.0130.00720.53
8.2.280.0040.00518.87
8.2.270.0110.00718.80
8.2.260.0060.01216.99
8.2.250.0040.00418.52
8.2.240.0030.00617.53
8.2.230.0030.00522.58
8.2.220.0030.00624.06
8.2.210.0040.00426.77
8.2.200.0080.00018.66
8.2.190.0090.00616.86
8.2.180.0350.01025.92
8.2.170.0320.00625.92
8.2.160.0270.01225.92
8.2.150.0340.00025.92
8.2.140.0300.01325.92
8.2.130.0300.01625.92
8.2.120.0410.01425.92
8.2.110.0320.01425.92
8.2.100.0300.01225.92
8.2.90.0300.00925.92
8.2.80.0350.01125.92
8.2.70.0340.00625.92
8.2.60.0360.01125.92
8.2.50.0390.01025.92
8.2.40.0320.00925.92
8.2.30.0300.01025.92
8.2.20.0270.01725.92
8.2.10.0230.01925.92
8.2.00.0440.00425.92
8.1.330.0120.00921.82
8.1.320.0110.00916.52
8.1.310.0110.00716.59
8.1.300.0070.01120.00
8.1.290.0060.00330.84
8.1.280.0420.01525.92
8.1.270.0380.00825.92
8.1.260.0330.00325.92
8.1.250.0390.00725.92
8.1.240.0300.00925.92
8.1.230.0360.00325.92
8.1.220.0290.01025.92
8.1.210.0370.00725.92
8.1.200.0320.01025.92
8.1.190.0370.00725.92
8.1.180.0380.00625.92
8.1.170.0360.00625.92
8.1.160.0340.00925.92
8.1.150.0350.00725.92
8.1.140.0290.01325.92
8.1.130.0350.00725.92
8.1.120.0330.01125.92
8.1.110.0210.02125.92
8.1.100.0250.02125.92
8.1.90.0380.01425.92
8.1.80.0400.00325.92
8.1.70.0340.00925.92
8.1.60.0420.02125.92
8.1.50.0480.00625.92
8.1.40.0480.00425.92
8.1.30.0440.01025.92
8.1.20.0400.00425.92
8.1.10.0320.00725.92
8.1.00.0360.00325.92

preferences:
28.71 ms | 403 KiB | 5 Q