3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])/im'; $str = 'Test text http://hello-world.com Test text http://google.com/file.jpg?google=1 Test text https://hell.o.wor.ld/test?qwe=qwe Test text text text http://test.test/test hello all how are you I hope you all are fine '; $utmUrl = "utm_source=source&utm_medium=email&utm_campaign=mycamp"; $str = preg_replace_callback($re, function ($match) use ($utmUrl) { return $match[0] . (strpos($match[0], '?') !== false ? '&' : '?') . $utmUrl . ' '; }, $str); var_dump($str);
based on 5SepA

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.0.30.0030.01617.04
8.0.20.0120.01117.25
8.0.00.0060.01217.03
7.4.130.0090.01016.65
7.4.120.0180.01116.61
7.4.110.0140.00316.45
7.4.100.0100.01116.60
7.4.90.0100.00816.77
7.4.80.0100.01016.71
7.4.70.0130.00816.69
7.4.60.0110.00816.58
7.4.50.0130.00516.59
7.4.40.0090.00916.63
7.4.30.0110.00816.59
7.4.20.0150.00516.62
7.4.10.0130.00516.68
7.4.00.0120.00616.65
7.3.260.0140.01416.52
7.3.230.0130.00516.68
7.3.220.0080.01216.65
7.3.210.0110.00616.53
7.3.200.0080.01116.58
7.3.190.0060.01116.55
7.3.180.0070.01016.76
7.3.170.0140.00316.46
7.3.160.0110.00816.64
7.3.150.0090.00716.60
7.3.140.0080.00816.57
7.3.130.0080.00816.54
7.3.120.0150.00316.74
7.3.110.0120.00716.50
7.3.100.0080.00916.72
7.3.90.0110.00916.37
7.3.80.0040.01416.52
7.3.70.0120.00716.55
7.3.60.0090.01016.50
7.3.50.0060.01116.34
7.3.40.0120.00616.50
7.3.30.0070.01016.54
7.3.20.0120.00916.54
7.3.10.0110.01216.50
7.3.00.0090.01016.52
7.2.340.0090.00916.75
7.2.330.0090.00916.82
7.2.320.0110.01016.78
7.2.310.0080.01116.74
7.2.300.0050.01216.77
7.2.290.0110.01016.86
7.2.280.0110.00716.76
7.2.270.0080.01216.88
7.2.260.0080.00916.76
7.2.250.0150.00716.69
7.2.240.0110.00916.77
7.2.230.0090.00816.74
7.2.220.0060.01216.68
7.2.210.0060.01316.77
7.2.200.0090.00916.73
7.2.190.0140.00616.81
7.2.180.0100.00916.74
7.2.170.0080.00816.90
7.2.160.0080.01016.90
7.2.150.0080.01016.80
7.2.140.0110.01116.83
7.2.130.0160.00316.71
7.2.120.0150.01216.62
7.2.110.0160.00916.80
7.2.100.0120.01016.69
7.2.90.0070.01516.60
7.2.80.0140.01316.79
7.2.70.0080.01216.60
7.2.60.0100.00916.70
7.2.50.0110.00616.73
7.2.40.0140.00716.77
7.2.30.0090.00916.64
7.2.20.0080.01016.71
7.2.10.0070.01116.71
7.2.00.0060.01216.65