3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Here is a url that contains some regex strings (see the (\d+) twice)? // I want to replace each one individually, using a regex of the regex, with the contents of the $params array // Final result should be http://whatever.com/en-GB/companies/8556/blah/502034/link/etc // Note they're in the correct order! $expectedUrl = "http://whatever.com/en-GB/companies/(\d+)/blah/(\d+)/link/etc"; preg_match_all('#\((.*?)\)#', $expectedUrl, $matches); $search = $matches[0]; $params = array(8556, 50234); foreach (array_combine($params, $search) as $value => $key) { $split = str_split($key); foreach ($split as &$char) { if ($char !== "\\") $char = "\\" . $char; } $split = implode("", $split); $expectedUrl = preg_replace("/".$split."/", $value, $expectedUrl, 1); } var_dump($expectedUrl);

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.60.0130.00718.68
8.3.50.0080.01122.07
8.3.40.0120.00318.91
8.3.30.0070.00719.13
8.3.20.0040.00420.16
8.3.10.0000.00822.10
8.3.00.0040.00422.46
8.2.180.0110.00716.88
8.2.170.0060.01522.96
8.2.160.0080.01121.05
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00726.16
8.2.120.0030.00617.75
8.2.110.0090.00022.21
8.2.100.0120.00018.03
8.2.90.0040.00419.20
8.2.80.0000.00817.97
8.2.70.0040.00417.50
8.2.60.0030.00517.93
8.2.50.0040.00418.07
8.2.40.0080.00018.34
8.2.30.0040.00418.20
8.2.20.0000.00817.77
8.2.10.0000.00817.89
8.2.00.0040.00418.00
8.1.280.0100.00325.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.01023.84
8.1.230.0080.00318.97
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0050.00517.60
8.1.190.0060.00317.52
8.1.180.0040.00418.70
8.1.170.0040.00418.82
8.1.160.0000.00822.08
8.1.150.0040.00418.70
8.1.140.0000.00717.71
8.1.130.0040.00417.81
8.1.120.0040.00417.66
8.1.110.0030.00617.50
8.1.100.0000.00717.64
8.1.90.0070.00017.58
8.1.80.0050.00317.50
8.1.70.0000.00817.54
8.1.60.0070.00417.66
8.1.50.0040.00417.57
8.1.40.0050.00317.70
8.1.30.0000.00817.75
8.1.20.0040.00417.79
8.1.10.0050.00217.74
8.1.00.0030.00517.66
8.0.300.0070.00018.77
8.0.290.0070.00017.05
8.0.280.0030.00518.32
8.0.270.0030.00317.37
8.0.260.0000.00816.96
8.0.250.0000.00717.15
8.0.240.0040.00417.17
8.0.230.0070.00017.06
8.0.220.0000.00716.96
8.0.210.0000.00717.03
8.0.200.0030.00317.09
8.0.190.0000.00816.97
8.0.180.0030.00317.07
8.0.170.0050.00317.04
8.0.160.0000.00717.07
8.0.150.0050.00317.11
8.0.140.0050.00316.89
8.0.130.0030.00313.51
8.0.120.0040.00417.00
8.0.110.0000.00716.97
8.0.100.0000.00717.03
8.0.90.0070.00017.02
8.0.80.0090.01017.11
8.0.70.0050.00316.90
8.0.60.0040.00416.91
8.0.50.0070.00017.06
8.0.30.0130.00717.37
8.0.20.0130.00617.40
8.0.10.0000.00717.07
8.0.00.0090.01116.97
7.4.330.0050.00015.00
7.4.320.0050.00216.80
7.4.300.0000.00716.76
7.4.290.0030.00316.73
7.4.280.0070.00016.64
7.4.270.0030.00616.80
7.4.260.0040.00416.63
7.4.250.0040.00416.82
7.4.240.0020.00616.72
7.4.230.0000.00716.78
7.4.220.0140.00616.75
7.4.210.0050.00916.77
7.4.200.0040.00416.89
7.4.190.0030.00616.98
7.4.160.0060.00916.69
7.4.150.0070.01017.40
7.4.140.0130.00417.86
7.4.130.0100.00816.65
7.4.120.0100.00816.76
7.4.110.0080.01616.60
7.4.100.0060.01816.85
7.4.90.0100.00716.65
7.4.80.0070.01019.39
7.4.70.0090.00816.62
7.4.60.0070.01316.70
7.4.50.0000.00816.37
7.4.40.0040.01422.77
7.4.30.0090.00616.77
7.4.00.0070.01015.24
7.3.330.0060.00013.45
7.3.320.0000.00513.38
7.3.310.0000.00716.61
7.3.300.0030.00316.52
7.3.290.0110.00416.43
7.3.280.0100.00716.52
7.3.270.0070.01017.40
7.3.260.0120.00616.77
7.3.250.0120.00616.73
7.3.240.0100.01016.47
7.3.230.0120.00616.64
7.3.210.0110.00616.73
7.3.200.0080.01419.39
7.3.190.0070.01016.75
7.3.180.0060.00916.51
7.3.170.0080.01316.85
7.3.160.0070.01016.75
7.3.120.0040.01415.16
7.2.330.0030.01416.89
7.2.320.0090.00916.71
7.2.310.0070.01017.00
7.2.300.0130.00916.89
7.2.290.0090.01216.80
7.2.00.0070.01019.57
7.1.100.0040.00818.54
7.1.70.0030.00617.30
7.1.60.0180.00719.82
7.1.50.0060.01617.27
7.1.00.0070.07322.51
7.0.200.0000.00716.75
7.0.140.0030.07021.96
7.0.60.0030.09019.98
7.0.50.0070.06017.92
7.0.40.0070.05020.11
7.0.30.0170.04320.11
7.0.20.0300.03720.19
7.0.10.0000.04720.18
7.0.00.0100.07320.05
5.6.280.0000.07721.02
5.6.210.0070.08320.69
5.6.200.0030.04718.13
5.6.190.0070.04020.75
5.6.180.4200.04020.27
5.6.170.0200.05020.71
5.6.160.0100.07020.32
5.6.150.0100.07718.16
5.6.140.0100.03018.09
5.6.130.0100.05318.16
5.6.120.0070.04021.01
5.6.110.0100.08321.13
5.6.100.0030.07320.96
5.6.90.0030.09320.96
5.6.80.0030.07720.52
5.6.70.2630.02720.36
5.5.350.0000.09020.32
5.5.340.0100.07317.95
5.5.330.0070.04320.37
5.5.320.0200.04020.32
5.5.310.0200.06320.18
5.5.300.0070.08317.91
5.5.290.0130.07017.89
5.5.280.0100.06320.83
5.5.270.0070.03720.77
5.5.260.0100.08320.79
5.5.250.0030.08720.68
5.5.240.0070.03720.26
5.4.450.0570.03019.21
5.4.440.0030.03319.23
5.4.430.0600.03319.56
5.4.420.1600.03319.40
5.4.410.0900.04019.36
5.4.400.0230.03319.13
5.4.390.0530.04019.11
5.4.380.0300.08018.56
5.4.370.0430.06018.48
5.4.360.0370.04718.45
5.4.350.0100.07018.69
5.4.340.0470.05018.68
5.4.320.0060.03712.46
5.4.310.0070.04512.45
5.4.300.0050.03712.46
5.4.290.0050.03912.45
5.4.280.0060.03512.35
5.4.270.0080.03812.35
5.4.260.0170.05718.87
5.4.250.0030.05318.87
5.4.240.0030.05718.93
5.4.230.0070.06719.03
5.4.220.0030.06318.70
5.4.210.0100.05318.88
5.4.200.0200.06318.88
5.4.190.0100.04718.89
5.4.180.0100.05318.72
5.4.170.0070.05318.64
5.4.160.0070.05318.76
5.4.150.0170.07318.74
5.4.140.0200.06016.53
5.4.130.0200.04716.27
5.4.120.0000.07016.30
5.4.110.0070.05016.44
5.4.100.0070.05016.29
5.4.90.0070.05016.44
5.4.80.0100.06316.25
5.4.70.0030.07716.43
5.4.60.0000.05716.41
5.4.50.0170.06316.32
5.4.40.0170.05316.38
5.4.30.0070.04716.20
5.4.20.0000.05316.41
5.4.10.0100.06316.34
5.4.00.0030.05015.83
5.3.290.0080.03712.80
5.3.280.0070.06714.65
5.3.270.0070.05714.30
5.3.260.0070.08014.63
5.3.250.0200.04014.48
5.3.240.0170.04314.62
5.3.230.0270.04714.49
5.3.220.0030.05714.46
5.3.210.0000.05714.45
5.3.200.0100.05314.66
5.3.190.0170.05014.49
5.3.180.0100.04714.58
5.3.170.0030.07714.45
5.3.160.0070.05014.63
5.3.150.0100.07014.57
5.3.140.0070.05714.48
5.3.130.0070.05014.40
5.3.120.0100.05714.55
5.3.110.0100.04714.46
5.3.100.0030.05313.89
5.3.90.0030.05014.03
5.3.80.0070.04714.02
5.3.70.0030.05013.79
5.3.60.0070.05013.71
5.3.50.0030.05013.96
5.3.40.0130.06313.80
5.3.30.0130.04013.92
5.3.20.0100.04713.68
5.3.10.0100.06013.80
5.3.00.0000.07013.68
5.2.170.0030.04711.07
5.2.160.0100.04010.98
5.2.150.0070.04010.90
5.2.140.0030.04311.25
5.2.130.0030.06011.25
5.2.120.0070.04711.11
5.2.110.0000.05311.11
5.2.100.0000.04711.02
5.2.90.0030.04311.00
5.2.80.0070.04011.02
5.2.70.0170.03311.25
5.2.60.0070.05710.97
5.2.50.0130.03311.04
5.2.40.0200.04011.01
5.2.30.0100.05011.00
5.2.20.0070.04310.86
5.2.10.0070.03311.02
5.2.00.0030.04010.94
5.1.60.0100.0339.96
5.1.50.0030.03310.04
5.1.40.0130.0409.89
5.1.30.0070.03310.40
5.1.20.0030.03710.25
5.1.10.0100.03710.12
5.1.00.0070.03310.25
5.0.50.0030.0308.39
5.0.40.0030.0378.42
5.0.30.0030.0408.28
5.0.20.0030.0278.04
5.0.10.0030.0278.17
5.0.00.0030.0438.13
4.4.90.0100.0237.30
4.4.80.0130.0237.30
4.4.70.0070.0237.30
4.4.60.0030.0277.30
4.4.50.0100.0107.30
4.4.40.0030.0437.30
4.4.30.0070.0177.30
4.4.20.0000.0237.30
4.4.10.0000.0237.30
4.4.00.0030.0337.30
4.3.110.0000.0337.30
4.3.100.0030.0207.30
4.3.90.0000.0307.30
4.3.80.0000.0407.30
4.3.70.0030.0207.30
4.3.60.0170.0177.30
4.3.50.0000.0237.30
4.3.40.0000.0377.30
4.3.30.0000.0277.30
4.3.20.0030.0307.30
4.3.10.0030.0277.30
4.3.00.0100.01313.23

preferences:
45.79 ms | 401 KiB | 5 Q