3v4l.org

run code in 300+ PHP versions simultaneously
<?php function stripSpecialCharater($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"; } // & is at ASCII decimal place 38 // © is at ASCII decimal place 169

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.0090.00618.56
8.3.50.0140.00016.55
8.3.40.0090.00919.18
8.3.30.0060.00919.00
8.3.20.0080.00021.90
8.3.10.0080.00020.90
8.3.00.0040.00419.38
8.2.180.0120.00618.66
8.2.170.0170.00022.96
8.2.160.0120.00320.39
8.2.150.0080.00025.66
8.2.140.0100.00024.66
8.2.130.0080.00019.66
8.2.120.0040.00426.35
8.2.110.0060.00322.27
8.2.100.0030.01218.22
8.2.90.0030.00518.00
8.2.80.0060.00317.97
8.2.70.0000.00917.93
8.2.60.0000.00818.22
8.2.50.0050.00318.10
8.2.40.0040.00419.53
8.2.30.0070.00019.37
8.2.20.0050.00218.07
8.2.10.0040.00421.37
8.2.00.0000.00718.30
8.1.280.0140.00325.92
8.1.270.0000.00720.38
8.1.260.0080.00026.35
8.1.250.0050.00228.09
8.1.240.0080.00520.57
8.1.230.0090.00319.07
8.1.220.0000.00817.78
8.1.210.0000.00818.77
8.1.200.0040.00417.48
8.1.190.0080.00017.48
8.1.180.0040.00418.10
8.1.170.0050.00318.77
8.1.160.0000.00818.85
8.1.150.0070.00019.06
8.1.140.0070.00018.96
8.1.130.0030.00720.20
8.1.120.0040.00417.63
8.1.110.0040.00417.63
8.1.100.0000.00817.61
8.1.90.0000.00817.57
8.1.80.0040.00417.50
8.1.70.0000.00717.62
8.1.60.0030.00617.79
8.1.50.0000.00817.58
8.1.40.0000.00917.70
8.1.30.0050.00317.73
8.1.20.0030.00617.76
8.1.10.0040.00417.59
8.1.00.0040.00417.61
8.0.300.0050.00319.95
8.0.290.0080.00016.88
8.0.280.0000.00718.46
8.0.270.0040.00417.20
8.0.260.0000.00718.48
8.0.250.0040.00417.16
8.0.240.0000.00717.26
8.0.230.0000.00817.19
8.0.220.0000.00717.18
8.0.210.0080.00016.99
8.0.200.0000.00617.09
8.0.190.0000.00717.14
8.0.180.0000.00817.03
8.0.170.0030.00517.07
8.0.160.0040.00417.07
8.0.150.0050.00217.00
8.0.140.0040.00417.05
8.0.130.0030.00313.39
8.0.120.0050.00517.17
8.0.110.0060.00317.16
8.0.100.0000.00917.13
8.0.90.0060.00317.12
8.0.80.0090.01417.23
8.0.70.0030.00617.25
8.0.60.0050.00517.09
8.0.50.0040.00417.25
8.0.30.0060.01517.45
8.0.20.0140.00717.27
8.0.10.0030.00617.25
8.0.00.0080.01317.17
7.4.330.0000.00515.55
7.4.320.0040.00416.77
7.4.300.0030.00316.77
7.4.290.0030.00316.89
7.4.280.0030.00516.78
7.4.270.0070.00016.77
7.4.260.0030.00616.68
7.4.250.0040.00416.84
7.4.240.0040.00817.00
7.4.230.0090.00017.02
7.4.220.0000.00917.11
7.4.210.0080.01216.98
7.4.200.0060.00317.14
7.4.160.0110.01016.90
7.4.140.0040.01817.86
7.4.130.0140.00716.86
7.4.120.0140.00716.75
7.4.110.0210.01016.77
7.4.100.0100.01016.71
7.4.90.0120.00716.89
7.4.80.0070.01719.39
7.4.70.0140.01016.91
7.4.60.0100.01116.77
7.4.50.0030.01516.78
7.4.40.0110.00916.72
7.4.30.0100.01016.84
7.4.20.0070.01516.81
7.4.10.0080.02016.75
7.4.00.0090.01116.09
7.3.330.0060.00013.33
7.3.320.0000.00513.32
7.3.310.0000.00816.72
7.3.300.0060.00316.48
7.3.290.0000.00916.63
7.3.280.0090.01216.62
7.3.260.0110.01216.75
7.3.240.0110.01016.78
7.3.230.0090.01017.02
7.3.210.0070.01416.86
7.3.200.0100.01416.84
7.3.190.0050.01616.75
7.3.180.0100.01616.66
7.3.170.0110.01016.86
7.3.160.0060.01416.99
7.3.150.0070.01016.76
7.3.140.0060.01416.95
7.3.130.0110.00816.83
7.3.120.0080.01316.85
7.3.110.0100.01016.65
7.3.100.0160.00616.79
7.3.90.0110.00716.68
7.3.80.0160.01416.61
7.3.70.0100.01016.43
7.3.60.0110.00816.76
7.3.50.0080.01316.54
7.3.40.0190.00416.52
7.3.30.0170.00316.55
7.3.20.0330.00815.83
7.3.10.0340.00415.93
7.3.00.0520.01215.87
7.2.330.0110.01116.99
7.2.320.0130.00717.06
7.2.310.0120.00917.00
7.2.300.0060.01416.98
7.2.290.0090.01017.07
7.2.280.0110.00816.96
7.2.270.0120.00917.01
7.2.260.0090.01216.91
7.2.250.0130.01017.13
7.2.240.0060.01217.10
7.2.230.0060.01416.94
7.2.220.0180.00416.98
7.2.210.0080.01216.98
7.2.200.0080.01216.95
7.2.190.0100.01116.96
7.2.180.0090.01216.89
7.2.170.0100.01516.88
7.2.160.0030.01817.04
7.2.150.0390.01616.22
7.2.140.0260.00916.17
7.2.130.0320.01016.30
7.2.120.0420.01516.28
7.2.110.0430.01016.13
7.2.100.0330.01316.22
7.2.90.0350.00816.09
7.2.80.0280.01216.15
7.2.70.0420.01316.20
7.2.60.0320.00516.24
7.2.50.0400.00916.15
7.2.40.0350.01416.09
7.2.30.0340.01116.18
7.2.20.0390.01516.13
7.2.10.0370.00516.03
7.2.00.0250.01116.07
7.1.330.0070.01116.22
7.1.320.0190.00616.09
7.1.310.0070.01115.67
7.1.300.0120.01615.93
7.1.290.0080.01515.84
7.1.280.0070.01115.85
7.1.270.0140.00515.90
7.1.260.0120.00816.05
7.1.250.0290.01215.12
7.1.240.0090.00915.90
7.1.230.0070.01116.06
7.1.220.0130.00416.00
7.1.210.0130.00615.98
7.1.200.0110.00815.91
7.1.190.0090.00915.89
7.1.180.0060.01315.85
7.1.170.0160.00815.93
7.1.160.0080.01715.98
7.1.150.0080.01815.98
7.1.140.0130.01616.04
7.1.130.0080.01416.05
7.1.120.0060.01215.92
7.1.110.0180.00016.07
7.1.100.0090.00916.08
7.1.90.0060.01215.91
7.1.80.0040.01415.82
7.1.70.0070.01115.99
7.1.60.0130.00516.00
7.1.50.0570.01015.92
7.1.40.0190.00015.98
7.1.30.0150.00415.91
7.1.20.0120.00616.11
7.1.10.0070.01016.13
7.1.00.0090.00915.99

preferences:
33.19 ms | 400 KiB | 5 Q