3v4l.org

run code in 300+ PHP versions simultaneously
<?php $callback = function ($matches) { $string = $matches[1]; $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.60.0140.00318.43
8.3.50.0070.01116.54
8.3.40.0180.00418.85
8.3.30.0040.01119.10
8.3.20.0080.00020.29
8.3.10.0080.00023.52
8.3.00.0000.00819.56
8.2.180.0090.00918.79
8.2.170.0070.01122.96
8.2.160.0070.00719.33
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0090.00019.45
8.2.120.0040.00426.35
8.2.110.0100.00021.13
8.2.100.0090.00318.16
8.2.90.0090.00019.34
8.2.80.0000.00917.97
8.2.70.0030.00617.75
8.2.60.0050.00318.16
8.2.50.0030.00518.16
8.2.40.0030.00520.45
8.2.30.0080.00019.34
8.2.20.0050.00218.08
8.2.10.0000.00818.15
8.2.00.0040.00418.08
8.1.280.0060.01225.92
8.1.270.0040.00422.10
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0080.00320.72
8.1.230.0000.01320.96
8.1.220.0040.00417.74
8.1.210.0050.00518.77
8.1.200.0030.00717.47
8.1.190.0000.00817.38
8.1.180.0000.00818.10
8.1.170.0030.00618.71
8.1.160.0040.00419.09
8.1.150.0050.00320.73
8.1.140.0040.00419.55
8.1.130.0030.00318.98
8.1.120.0040.00417.55
8.1.110.0040.00417.46
8.1.100.0040.00417.61
8.1.90.0070.00017.61
8.1.80.0000.00817.52
8.1.70.0040.00717.65
8.1.60.0040.00417.79
8.1.50.0000.00817.55
8.1.40.0000.01117.64
8.1.30.0040.00417.84
8.1.20.0040.00417.86
8.1.10.0020.00517.76
8.1.00.0040.00417.57
8.0.300.0040.00420.09
8.0.290.0030.00617.00
8.0.280.0030.00318.52
8.0.270.0050.00317.22
8.0.260.0030.00616.97
8.0.250.0070.00017.07
8.0.240.0040.00417.21
8.0.230.0030.00317.11
8.0.220.0000.00816.95
8.0.210.0070.00016.99
8.0.200.0000.00617.17
8.0.190.0000.00917.10
8.0.180.0070.00017.09
8.0.170.0000.00817.16
8.0.160.0000.00717.16
8.0.150.0030.00317.14
8.0.140.0040.00417.12
8.0.130.0000.00513.59
8.0.120.0000.00717.05
8.0.110.0030.00417.09
8.0.100.0000.00716.97
8.0.90.0000.00816.91
8.0.80.0120.00316.99
8.0.70.0080.00017.05
8.0.60.0040.00417.04
8.0.50.0000.00817.00
8.0.30.0120.00817.34
8.0.20.0170.00817.47
8.0.10.0030.00617.22
8.0.00.0140.00717.19
7.4.330.0000.00515.55
7.4.320.0030.00316.68
7.4.300.0000.00616.80
7.4.290.0000.00716.62
7.4.280.0050.00316.70
7.4.270.0040.00416.80
7.4.260.0050.00316.62
7.4.250.0030.00516.73
7.4.240.0050.00216.75
7.4.230.0040.00416.90
7.4.220.0070.01416.84
7.4.210.0100.00716.75
7.4.200.0020.00516.59
7.4.160.0090.00816.72
7.4.150.0090.01217.40
7.4.140.0120.01117.86
7.4.130.0090.00916.93
7.4.120.0140.00816.71
7.4.110.0120.00416.70
7.4.100.0140.01216.64
7.4.90.0070.01116.53
7.4.80.0090.00919.39
7.4.70.0120.00616.78
7.4.60.0060.01116.75
7.4.50.0060.01216.72
7.4.40.0070.01016.66
7.4.30.0040.01316.66
7.4.10.0070.01015.03
7.4.00.0110.00715.16
7.3.330.0060.00013.43
7.3.320.0030.00313.57
7.3.310.0040.00416.44
7.3.300.0030.00316.52
7.3.290.0060.00916.47
7.3.280.0070.01016.51
7.3.270.0090.00917.40
7.3.260.0050.01316.69
7.3.250.0080.01016.52
7.3.240.0090.00816.58
7.3.230.0150.00516.71
7.3.210.0150.00416.55
7.3.200.0120.00416.90
7.3.190.0090.00816.53
7.3.180.0130.00316.60
7.3.170.0000.01716.84
7.3.160.0120.00316.56
7.3.130.0100.01014.92
7.3.120.0100.00715.08
7.3.110.0070.01015.20
7.3.100.0100.00315.17
7.3.90.0030.01015.06
7.3.80.0080.00615.00
7.3.70.0060.00614.94
7.3.60.0090.00615.14
7.3.50.0030.01314.88
7.3.40.0060.00315.10
7.3.30.0030.00614.82
7.3.20.0060.00316.96
7.3.10.0030.01016.66
7.3.00.0100.00416.77
7.2.330.0090.00916.84
7.2.320.0100.00716.81
7.2.310.0100.00716.80
7.2.300.0190.00416.94
7.2.290.0030.01616.78
7.2.260.0070.01115.20
7.2.250.0070.01015.32
7.2.240.0140.00315.03
7.2.230.0040.01115.03
7.2.220.0040.00715.27
7.2.210.0000.01115.16
7.2.200.0040.00715.09
7.2.190.0070.00715.32
7.2.180.0030.01315.13
7.2.170.0040.00715.24
7.2.160.0120.00314.97
7.2.150.0030.01316.98
7.2.140.0120.00317.32
7.2.130.0050.00817.09
7.2.120.0100.00716.85
7.2.110.0050.01216.98
7.2.100.0070.00716.82
7.2.90.0130.00117.04
7.2.80.0060.00917.12
7.2.70.0070.00617.19
7.2.60.0070.00817.08
7.2.50.0050.00717.01
7.2.40.0060.00617.05
7.2.30.0070.00717.10
7.2.20.0020.00917.03
7.2.10.0030.00717.12
7.2.00.0080.00617.90
7.1.330.0060.00615.93
7.1.320.0030.01015.90
7.1.310.0000.01115.90
7.1.300.0090.00015.83
7.1.290.0070.00715.92
7.1.280.0050.00516.14
7.1.270.0000.01015.96
7.1.260.0090.00615.75
7.1.250.0080.00615.88
7.1.240.0040.00715.75
7.1.230.0030.01316.01
7.1.220.0060.01215.78
7.1.210.0040.00816.01
7.1.200.0090.00915.89
7.1.190.0000.01415.87
7.1.180.0060.00316.06
7.1.170.0040.00715.97
7.1.160.0030.00915.93
7.1.150.0000.01415.89
7.1.140.0040.01115.91
7.1.130.0070.00715.89
7.1.120.0070.00415.82
7.1.110.0030.00815.97
7.1.100.0060.00817.17
7.1.90.0100.00715.95
7.1.80.0030.01015.89
7.1.70.0090.00416.62
7.1.60.0180.00825.54
7.1.50.0130.01525.32
7.1.40.0080.01225.26
7.1.30.0150.00525.45
7.1.20.0500.01224.47
7.1.10.0050.01116.43
7.1.00.0430.01115.61
7.0.330.0030.00615.65
7.0.320.0040.00815.39
7.0.310.0060.00615.55
7.0.300.0000.01315.61
7.0.290.0120.00315.47
7.0.280.0030.00715.41
7.0.270.0030.00715.37
7.0.260.0030.00715.50
7.0.250.0070.00715.75
7.0.240.0000.01515.68
7.0.230.0030.00915.16
7.0.220.0100.00315.68
7.0.210.0030.00715.73
7.0.200.0080.00916.27
7.0.190.0040.01216.13
7.0.180.0070.00716.07
7.0.170.0060.00715.92
7.0.160.0050.01116.03
7.0.150.0060.00815.82
7.0.140.0050.01116.13
7.0.130.0370.01015.19
7.0.120.0360.00715.30
7.0.110.0040.01315.95
7.0.100.0050.01216.02
7.0.90.0280.00915.19
7.0.80.0300.00815.24
7.0.70.0070.01015.91
7.0.60.0250.01015.17
7.0.50.0270.01215.22
7.0.40.0330.00715.13
7.0.30.0280.00914.13
7.0.20.0210.00914.23
7.0.10.0250.01214.19
7.0.00.0060.01115.13
5.6.400.0000.01514.56
5.6.390.0080.00314.48
5.6.380.0100.00714.43
5.6.370.0030.01414.20
5.6.360.0100.00614.63
5.6.350.0030.00614.52
5.6.340.0080.00414.42
5.6.330.0110.00314.02
5.6.320.0000.00914.84
5.6.310.0070.01014.60
5.6.300.0030.00714.68
5.6.290.0070.00714.50
5.6.280.0000.01714.50
5.6.270.0060.00914.14
5.6.260.0030.01414.41
5.6.250.0070.00714.46
5.6.240.0100.00314.63
5.6.230.0070.00714.30
5.6.220.0050.01014.43
5.6.210.0070.01114.25
5.6.200.0050.00914.75
5.6.190.0030.00714.56
5.6.180.0030.01414.64
5.6.170.0000.00914.66
5.6.160.0060.00914.57
5.6.150.0000.01314.33
5.6.140.0030.00614.55
5.6.130.0040.00814.31
5.6.120.0000.01414.27
5.6.110.0030.01414.27
5.6.100.0000.01414.45
5.6.90.0090.00614.40
5.6.80.0000.01414.27
5.6.70.0090.00314.24
5.6.60.0060.00614.45
5.6.50.0060.00314.40
5.6.40.0030.01214.21
5.6.30.0060.00314.25
5.6.20.0000.00814.28
5.6.10.0060.00314.20
5.6.00.0060.00814.26

preferences:
41.14 ms | 400 KiB | 5 Q