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"; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0); foreach ($matches as $match) $str = preg_replace('%' . $match[0] . '%', $match[0] . (strpos($match[0], '?') !== false ? '&' : '?') . $utmUrl, $str); var_dump($str); // Test text http://hello-world.com?utm_source=source&utm_medium=email&utm_campaign=mycamp 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?utm_source=source&utm_medium=email&utm_campaign=mycamp hello all how are you I hope you all are fine

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.3.40.0070.00721.78
8.3.30.0100.00518.61
8.3.20.0000.00924.18
8.3.10.0090.00024.66
8.3.00.0050.00326.16
8.2.170.0180.00319.15
8.2.160.0130.00322.96
8.2.150.0000.00825.66
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0050.00318.85
8.2.110.0090.00022.18
8.2.100.0060.00919.76
8.2.90.0050.00317.88
8.2.80.0060.00318.86
8.2.70.0040.00417.88
8.2.60.0040.00417.93
8.2.50.0030.00518.07
8.2.40.0000.00820.54
8.2.30.0070.00018.21
8.2.20.0050.00318.21
8.2.10.0030.00519.35
8.2.00.0000.00719.31
8.1.270.0040.00423.99
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0070.00419.34
8.1.230.0110.00018.01
8.1.220.0060.00317.91
8.1.210.0040.00418.77
8.1.200.0040.00717.61
8.1.190.0000.00817.48
8.1.180.0040.00418.10
8.1.170.0060.00318.74
8.1.160.0080.00018.91
8.1.150.0040.00418.95
8.1.140.0040.00418.96
8.1.130.0000.00720.24
8.1.120.0040.00417.57
8.1.110.0030.00517.64
8.1.100.0040.00417.70
8.1.90.0030.00617.68
8.1.80.0000.00717.68
8.1.70.0030.00317.61
8.1.60.0040.00417.77
8.1.50.0060.00317.70
8.1.40.0000.00817.72
8.1.30.0040.00417.75
8.1.20.0030.00517.85
8.1.10.0050.00317.70
8.1.00.0040.00417.62
8.0.300.0080.00018.77
8.0.290.0040.00417.00
8.0.280.0050.00318.46
8.0.270.0050.00318.21
8.0.260.0000.00718.46
8.0.250.0000.00817.04
8.0.240.0070.00017.14
8.0.230.0000.00717.02
8.0.220.0070.00017.13
8.0.210.0000.00717.07
8.0.200.0000.00717.10
8.0.190.0050.00217.05
8.0.180.0000.00717.11
8.0.170.0030.00616.94
8.0.160.0000.00816.92
8.0.150.0050.00216.91
8.0.140.0000.00716.93
8.0.130.0030.00313.47
8.0.120.0070.00017.03
8.0.110.0040.00417.09
8.0.100.0080.00017.03
8.0.90.0040.00417.07
8.0.80.0060.00917.02
8.0.70.0040.00417.10
8.0.60.0020.00517.05
8.0.50.0000.00717.14
8.0.30.0060.01217.05
8.0.20.0090.01217.44
8.0.10.0040.00417.31
8.0.00.0150.00416.73
7.4.330.0000.00515.55
7.4.320.0000.00716.71
7.4.300.0060.00016.70
7.4.290.0070.00016.71
7.4.280.0000.00916.77
7.4.270.0080.00016.68
7.4.260.0000.00613.53
7.4.250.0030.00316.85
7.4.240.0000.00716.69
7.4.230.0030.00316.66
7.4.220.0040.00416.90
7.4.210.0110.00616.78
7.4.200.0000.00716.79
7.4.130.0180.00316.81
7.4.120.0180.01016.75
7.4.110.0110.00816.57
7.4.100.0060.01216.66
7.4.90.0030.01216.88
7.4.80.0030.01316.80
7.4.70.0120.00616.67
7.4.60.0120.00616.65
7.4.50.0090.00916.73
7.4.40.0120.00616.46
7.4.30.0120.00616.71
7.4.20.0110.00616.53
7.4.10.0100.01316.76
7.4.00.0030.01416.59
7.3.330.0050.00216.35
7.3.320.0000.00513.38
7.3.310.0000.00716.58
7.3.300.0030.00316.38
7.3.290.0090.00816.43
7.3.260.0070.01116.80
7.3.230.0090.00816.67
7.3.220.0110.00716.53
7.3.210.0090.00616.56
7.3.200.0070.01116.59
7.3.190.0100.01016.33
7.3.180.0120.00616.55
7.3.170.0100.00716.28
7.3.160.0060.01116.57
7.3.150.0070.01016.84
7.3.140.0070.01116.72
7.3.130.0040.01416.58
7.3.120.0030.01516.58
7.3.110.0090.00916.52
7.3.100.0110.00716.38
7.3.90.0070.01016.46
7.3.80.0130.00316.56
7.3.70.0180.00316.42
7.3.60.0070.01016.62
7.3.50.0030.01416.46
7.3.40.0110.00616.46
7.3.30.0040.01216.52
7.3.20.0100.01316.47
7.3.10.0120.01116.54
7.3.00.0130.00716.43
7.2.340.0070.01116.88
7.2.330.0060.01316.84
7.2.320.0090.00816.62
7.2.310.0060.01216.72
7.2.300.0090.00916.84
7.2.290.0110.01116.61
7.2.280.0160.00516.70
7.2.270.0140.00316.81
7.2.260.0090.00916.66
7.2.250.0130.00616.73
7.2.240.0100.00716.77
7.2.230.0090.01016.89
7.2.220.0060.01216.67
7.2.210.0130.00716.81
7.2.200.0100.01316.79
7.2.190.0070.01116.75
7.2.180.0040.01316.74
7.2.170.0070.01016.64
7.2.160.0110.01116.74
7.2.150.0140.01016.81
7.2.140.0080.01116.93
7.2.130.0090.00916.80
7.2.120.0130.00616.82
7.2.110.0090.00916.94
7.2.100.0080.01216.70
7.2.90.0090.01016.86
7.2.80.0070.01016.97
7.2.70.0110.00716.75
7.2.60.0130.00616.71
7.2.50.0090.00916.81
7.2.40.0110.00816.91
7.2.30.0160.01016.84
7.2.20.0070.01316.94
7.2.10.0170.00316.89
7.2.00.0320.02816.83

preferences:
59.37 ms | 400 KiB | 5 Q