3v4l.org

run code in 300+ PHP versions simultaneously
<?php function stripSpecialCharater($string) { return preg_replace(['/\s{2,}|[\t\R]/u', '/[^a-z\d\s&‚~§©ÂÃ⃀-]/ui'], [' ', ''], $string); //$string = iconv("Windows-1252","UTF-8",urldecode($string)); //$string = preg_replace(array('/\s{2,}/', '/[\t\n]/'), ' ', $string); //return preg_replace('/[^a-zA-Z0-9ç&-©‚ƒ‘\s]/', '', $string); } $tests = ['12 34', 'adsf', 'co©', 'pound £']; foreach ($tests as $test) { echo "$test : " , stripSpecialCharater($test), "\n"; }

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.0190.00318.43
8.3.50.0120.00616.39
8.3.40.0140.00718.60
8.3.30.0090.00618.84
8.3.20.0000.00721.77
8.3.10.0040.00420.66
8.3.00.0040.00419.38
8.2.180.0090.00618.66
8.2.170.0100.00522.96
8.2.160.0070.01420.38
8.2.150.0100.00024.18
8.2.140.0030.00624.66
8.2.130.0040.00419.97
8.2.120.0040.00426.35
8.2.110.0030.00619.45
8.2.100.0120.00017.84
8.2.90.0030.00618.22
8.2.80.0080.00017.97
8.2.70.0040.00417.93
8.2.60.0070.00018.22
8.2.50.0040.00418.10
8.2.40.0050.00319.42
8.2.30.0040.00419.29
8.2.20.0040.00417.96
8.2.10.0050.00319.31
8.2.00.0070.00018.05
8.1.280.0110.00725.92
8.1.270.0060.00320.21
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0090.00022.54
8.1.230.0070.00420.89
8.1.220.0000.00817.74
8.1.210.0040.00418.97
8.1.200.0000.00917.13
8.1.190.0080.00319.01
8.1.180.0050.00318.10
8.1.170.0040.00418.59
8.1.160.0000.00718.88
8.1.150.0080.00018.88
8.1.140.0080.00020.18
8.1.130.0040.00417.32
8.1.120.0070.00317.42
8.1.110.0040.00417.46
8.1.100.0000.00717.43
8.1.90.0040.00417.50
8.1.80.0040.00417.48
8.1.70.0070.00017.41
8.1.60.0000.00817.58
8.1.50.0040.00417.53
8.1.40.0000.00817.54
8.1.30.0030.00617.48
8.1.20.0030.00617.61
8.1.10.0050.00317.50
8.1.00.0040.00417.40
8.0.300.0040.00419.86
8.0.290.0060.00316.75
8.0.280.0000.00718.50
8.0.270.0030.00317.24
8.0.260.0070.00016.85
8.0.250.0070.00017.04
8.0.240.0080.00316.88
8.0.230.0040.00416.99
8.0.220.0000.00716.97
8.0.210.0030.00316.93
8.0.200.0070.00017.07
8.0.190.0040.00416.89
8.0.180.0040.00416.98
8.0.170.0030.00616.98
8.0.160.0040.00417.04
8.0.150.0040.00416.95
8.0.140.0030.00516.73
8.0.130.0000.00613.37
8.0.120.0030.00516.93
8.0.110.0000.00716.98
8.0.100.0040.00416.83
8.0.90.0070.00016.80
8.0.80.0050.01016.97
8.0.70.0000.00717.05
8.0.60.0000.00816.95
8.0.50.0070.00016.94
8.0.30.0130.00517.17
8.0.20.0060.01317.00
8.0.10.0070.00017.11
8.0.00.0110.00816.92
7.4.330.0020.00215.55
7.4.320.0060.00016.61
7.4.300.0070.00016.54
7.4.290.0030.00316.57
7.4.280.0000.00916.67
7.4.270.0070.00416.48
7.4.260.0030.00516.64
7.4.250.0000.00716.51
7.4.240.0070.00016.67
7.4.230.0030.00316.55
7.4.220.0000.00916.46
7.4.210.0090.00816.64
7.4.200.0080.00016.31
7.4.160.0120.00416.70
7.4.140.0130.01017.86
7.4.130.0140.00416.57
7.4.120.0150.00916.55
7.4.110.0160.00416.64
7.4.100.0070.01016.51
7.4.90.0090.00916.50
7.4.80.0060.01119.39
7.4.70.0120.01216.46
7.4.60.0130.00316.68
7.4.50.0100.00716.21
7.4.40.0140.00316.37
7.4.00.0030.01415.03
7.3.330.0050.00013.34
7.3.320.0030.00313.44
7.3.310.0040.00416.38
7.3.300.0030.00316.52
7.3.290.0000.00716.47
7.3.280.0110.00416.50
7.3.260.0120.01016.69
7.3.240.0070.01216.65
7.3.230.0120.00616.63
7.3.210.0100.00716.87
7.3.200.0140.00316.75
7.3.190.0060.01216.55
7.3.180.0090.00616.71
7.3.170.0130.00916.53
7.3.160.0100.01316.70
7.3.120.0030.01014.78
7.3.110.0060.01214.79
7.3.100.0090.00615.04
7.3.90.0070.00714.84
7.3.80.0030.01014.89
7.3.70.0060.00615.18
7.3.60.0000.00914.91
7.3.50.0080.00414.92
7.3.40.0070.00414.72
7.3.30.0000.00915.16
7.3.20.0380.00915.61
7.3.10.0390.00715.53
7.3.00.0320.00715.51
7.2.330.0090.00916.62
7.2.320.0070.01716.73
7.2.310.0060.01216.80
7.2.300.0150.00316.89
7.2.290.0120.00616.77
7.2.250.0060.01215.02
7.2.240.0060.01315.16
7.2.230.0080.01115.20
7.2.220.0080.00414.96
7.2.210.0100.00315.33
7.2.200.0060.00615.31
7.2.190.0130.00315.24
7.2.180.0070.00715.15
7.2.170.0030.00615.02
7.2.150.0510.00615.24
7.2.140.0490.00615.28
7.2.130.0470.00315.19
7.2.120.0530.00815.18
7.2.110.0790.00515.14
7.2.100.0440.00615.18
7.2.90.0420.00915.04
7.2.80.0540.00515.02
7.2.70.0550.00415.14
7.2.60.0460.00715.26
7.2.50.0520.00915.21
7.2.40.0470.00315.30
7.2.30.0380.00615.07
7.2.20.0390.00815.24
7.2.10.0390.00815.17
7.2.00.0400.00815.25
7.1.330.0070.01016.04
7.1.320.0020.01216.01
7.1.310.0060.00916.15
7.1.300.0040.00416.04
7.1.290.0030.01216.00
7.1.280.0030.00715.61
7.1.270.0070.00716.14
7.1.260.0030.00615.95
7.1.250.0610.00314.08

preferences:
45.07 ms | 400 KiB | 5 Q