3v4l.org

run code in 300+ PHP versions simultaneously
<?php $callback = function ($matches) { $string = $matches[0]; $string = str_replace(' ', '', $string); // remove unwanted whitespace $string = str_replace('(,', '(', $string); // remove unwanted comma $string = str_replace(',)', ')', $string); // remove unwanted comma $string = str_replace(',,', ',', $string); return $string; }; $string = '(`anurag`, 1,2), (1,2,3, `dm0c60544`),(2 ,3 ,3) '; $pattern = '#[0-9,()]#'; // our regex pattern $string = preg_replace_callback($pattern, $callback, $string); //replace backticked text and the following comma echo $string;

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.0110.01119.09
8.3.30.0140.00019.14
8.3.20.0080.00020.21
8.3.10.0080.00023.66
8.3.00.0040.00419.56
8.2.170.0100.00722.96
8.2.160.0040.01119.33
8.2.150.0110.00724.18
8.2.140.0030.00524.66
8.2.130.0060.00319.30
8.2.120.0040.00426.35
8.2.110.0070.01121.00
8.2.100.0080.00317.91
8.2.90.0000.00819.35
8.2.80.0000.00817.97
8.2.70.0070.00317.88
8.2.60.0080.00017.93
8.2.50.0060.00318.10
8.2.40.0000.00820.59
8.2.30.0000.00719.26
8.2.20.0040.00418.15
8.2.10.0050.00318.05
8.2.00.0040.00418.08
8.1.270.0050.00322.28
8.1.260.0030.00626.35
8.1.250.0040.00428.09
8.1.240.0090.00022.18
8.1.230.0110.00018.95
8.1.220.0030.00617.74
8.1.210.0050.00318.77
8.1.200.0060.00317.48
8.1.190.0030.00617.48
8.1.180.0030.00618.10
8.1.170.0040.00418.67
8.1.160.0040.00418.96
8.1.150.0060.00320.70
8.1.140.0040.00419.68
8.1.130.0000.00718.99
8.1.120.0000.00817.61
8.1.110.0060.00317.54
8.1.100.0050.00217.66
8.1.90.0070.00017.66
8.1.80.0040.00417.64
8.1.70.0000.00917.53
8.1.60.0070.00017.70
8.1.50.0000.00917.73
8.1.40.0040.00817.57
8.1.30.0000.01017.84
8.1.20.0080.00017.73
8.1.10.0070.00017.75
8.1.00.0040.00417.64
8.0.300.0060.00318.77
8.0.290.0060.00316.75
8.0.280.0040.00418.43
8.0.270.0000.00717.28
8.0.260.0100.00016.98
8.0.250.0030.00317.08
8.0.240.0040.00416.98
8.0.230.0070.00016.88
8.0.220.0000.00816.95
8.0.210.0000.00816.85
8.0.200.0030.00316.99
8.0.190.0000.00917.12
8.0.180.0000.00717.02
8.0.170.0040.00417.09
8.0.160.0030.00317.00
8.0.150.0040.00416.98
8.0.140.0030.00316.98
8.0.130.0000.00513.40
8.0.120.0000.00717.05
8.0.110.0070.00017.06
8.0.100.0050.00216.93
8.0.90.0000.00817.07
8.0.80.0060.00916.96
8.0.70.0050.00316.94
8.0.60.0040.00416.93
8.0.50.0000.00717.16
8.0.30.0140.00517.18
8.0.20.0120.00817.40
8.0.10.0030.00617.08
8.0.00.0130.00717.20
7.4.330.0000.00515.55
7.4.320.0000.00616.73
7.4.300.0030.00316.65
7.4.290.0030.00616.79
7.4.280.0080.00016.81
7.4.270.0030.00516.67
7.4.260.0040.00416.60
7.4.250.0030.00616.82
7.4.240.0070.00016.84
7.4.230.0050.00216.81
7.4.220.0090.01016.90
7.4.210.0110.01116.84
7.4.200.0030.00316.92
7.4.160.0110.00516.72
7.4.150.0110.00717.40
7.4.140.0050.01417.86
7.4.130.0160.00616.92
7.4.120.0120.00816.70
7.4.110.0060.00916.87
7.4.100.0040.01516.82
7.4.90.0040.01316.86
7.4.80.0090.01119.39
7.4.70.0060.00916.59
7.4.60.0090.00916.82
7.4.50.0150.00016.70
7.4.40.0070.01016.80
7.4.30.0060.00916.69
7.4.00.0140.00315.29
7.3.330.0000.00613.29
7.3.320.0050.00213.48
7.3.310.0030.00316.46
7.3.300.0030.00316.38
7.3.290.0050.01016.45
7.3.280.0090.00916.42
7.3.270.0090.00917.40
7.3.260.0100.00716.61
7.3.250.0120.00716.52
7.3.240.0050.01116.54
7.3.230.0060.01216.56
7.3.210.0100.00716.91
7.3.200.0070.01016.48
7.3.190.0110.01216.59
7.3.180.0100.00716.55
7.3.170.0100.00716.51
7.3.160.0060.01016.49
7.2.330.0140.00516.93
7.2.320.0090.01316.88
7.2.310.0040.01216.96
7.2.300.0030.01316.96
7.2.290.0030.01316.71
7.2.60.0070.01017.04
7.2.00.0000.01419.45
7.1.200.0160.00315.87
7.1.100.0000.01218.14
7.1.70.0130.00317.40
7.1.60.0350.01335.04
7.1.50.0290.01534.97
7.1.40.0270.01834.35
7.1.30.0250.02134.74
7.1.20.0310.01335.00
7.1.10.0070.01416.74
7.1.00.0070.01116.80
7.0.200.0070.01317.05
7.0.190.0110.00916.84
7.0.180.0070.01116.31
7.0.170.0070.01416.37
7.0.160.0120.00916.38
7.0.150.0040.01516.33
7.0.140.0690.00316.69
7.0.130.0030.01716.63
7.0.120.0150.00616.49
7.0.110.0470.00914.75
7.0.100.0300.01514.91
7.0.90.0160.00316.44
7.0.80.0120.00916.45
7.0.70.0080.01416.53
7.0.60.0530.01314.44
7.0.50.0070.01416.48
7.0.40.0520.02114.66
7.0.30.0570.00614.93
7.0.20.0320.01414.73
7.0.10.0400.01614.73
7.0.00.0080.01516.63

preferences:
50.15 ms | 400 KiB | 5 Q