3v4l.org

run code in 300+ PHP versions simultaneously
<?php function stripNonValidCharaters ($message) { $validGSMKeycodes = [ 0x0040, 0x0394, 0x0020, 0x0030, 0x00a1, 0x0050, 0x00bf, 0x0070, 0x00a3, 0x005f, 0x0021, 0x0031, 0x0041, 0x0051, 0x0061, 0x0071, 0x0024, 0x03a6, 0x0022, 0x0032, 0x0042, 0x0052, 0x0062, 0x0072, 0x00a5, 0x0393, 0x0023, 0x0033, 0x0043, 0x0053, 0x0063, 0x0073, 0x00e8, 0x039b, 0x00a4, 0x0034, 0x0035, 0x0044, 0x0054, 0x0064, 0x0074, 0x00e9, 0x03a9, 0x0025, 0x0045, 0x0045, 0x0055, 0x0065, 0x0075, 0x00f9, 0x03a0, 0x0026, 0x0036, 0x0046, 0x0056, 0x0066, 0x0076, 0x00ec, 0x03a8, 0x0027, 0x0037, 0x0047, 0x0057, 0x0067, 0x0077, 0x00f2, 0x03a3, 0x0028, 0x0038, 0x0048, 0x0058, 0x0068, 0x0078, 0x00c7, 0x0398, 0x0029, 0x0039, 0x0049, 0x0059, 0x0069, 0x0079, 0x000a, 0x039e, 0x002a, 0x003a, 0x004a, 0x005a, 0x006a, 0x007a, 0x00d8, 0x001b, 0x002b, 0x003b, 0x004b, 0x00c4, 0x006b, 0x00e4, 0x00f8, 0x00c6, 0x002c, 0x003c, 0x004c, 0x00d6, 0x006c, 0x00f6, 0x000d, 0x00e6, 0x002d, 0x003d, 0x004d, 0x00d1, 0x006d, 0x00f1, 0x00c5, 0x00df, 0x002e, 0x003e, 0x004e, 0x00dc, 0x006e, 0x00fc, 0x00e5, 0x00c9, 0x002f, 0x003f, 0x004f, 0x00a7, 0x006f, 0x00e0 ]; $count = 0; for($i = 0; $i < strlen($message); $i++) { if(!in_array(ord($message[$i]), $validGSMKeycodes)) { var_dump(ord($message[$i])); $message[$i] = ''; $count++; } } return ['message' => $message, 'replacements' => $count]; } $msg = "Dear Alex Here are some funky characters sdfjsdfj sldfj sd !!?!?>)SD(*ASD09 усский алфавит T"; $tmp = ' '; while ($tmp != $msg) { $tmp = stripNonValidCharaters($msg); $msg = $tmp; } var_dump($msg);

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.0070.00718.43
8.3.50.0110.01122.09
8.3.40.0070.00718.99
8.3.30.0100.00319.05
8.3.20.0070.00020.20
8.3.10.0040.00423.49
8.3.00.0090.00019.63
8.2.180.0100.00716.88
8.2.170.0040.01122.96
8.2.160.0130.00020.57
8.2.150.0050.00324.18
8.2.140.0100.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00422.23
8.2.110.0030.00620.41
8.2.100.0000.01217.99
8.2.90.0050.00319.30
8.2.80.0050.00517.97
8.2.70.0060.00317.75
8.2.60.0000.00817.93
8.2.50.0000.00818.07
8.2.40.0000.00819.95
8.2.30.0020.00518.14
8.2.20.0000.00817.80
8.2.10.0000.00718.07
8.2.00.0030.00517.86
8.1.280.0070.00725.92
8.1.270.0060.00623.99
8.1.260.0040.01126.35
8.1.250.0040.00428.09
8.1.240.0040.00424.00
8.1.230.0040.00718.97
8.1.220.0000.00817.75
8.1.210.0030.00518.77
8.1.200.0030.00617.23
8.1.190.0080.00017.35
8.1.180.0040.00418.10
8.1.170.0070.00318.66
8.1.160.0080.00021.90
8.1.150.0020.00518.90
8.1.140.0040.00417.48
8.1.130.0070.00017.90
8.1.120.0040.00417.53
8.1.110.0070.00017.38
8.1.100.0040.00417.36
8.1.90.0040.00417.51
8.1.80.0070.00017.36
8.1.70.0070.00017.43
8.1.60.0050.00317.55
8.1.50.0030.00617.59
8.1.40.0000.00717.53
8.1.30.0050.00317.52
8.1.20.0020.00517.58
8.1.10.0060.00317.63
8.1.00.0040.00417.52
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0030.00318.40
8.0.270.0030.00317.20
8.0.260.0030.00317.18
8.0.250.0030.00316.93
8.0.240.0000.00617.02
8.0.230.0000.00717.06
8.0.220.0070.00016.88
8.0.210.0030.00316.97
8.0.200.0040.00417.09
8.0.190.0000.00916.89
8.0.180.0000.00717.01
8.0.170.0040.00416.97
8.0.160.0040.00417.00
8.0.150.0070.00016.87
8.0.140.0000.00716.91
8.0.130.0000.00613.39
8.0.120.0040.00416.94
8.0.110.0000.00717.01
8.0.100.0000.00716.82
8.0.90.0000.00816.95
8.0.80.0090.01216.91
8.0.70.0030.00617.08
8.0.60.0030.00616.80
8.0.50.0050.00316.87
8.0.30.0160.00817.15
8.0.20.0120.00917.40
8.0.10.0040.00417.16
8.0.00.0100.00816.81
7.4.330.0050.00015.00
7.4.320.0030.00316.55
7.4.300.0030.00316.54
7.4.290.0070.00016.52
7.4.280.0070.00016.61
7.4.270.0030.00316.61
7.4.260.0040.00416.59
7.4.250.0000.00816.54
7.4.240.0020.00516.61
7.4.230.0030.00316.65
7.4.220.0120.00816.71
7.4.210.0070.01316.56
7.4.200.0030.00316.41
7.4.160.0000.01616.53
7.4.150.0090.00917.40
7.4.140.0110.00917.86
7.4.130.0150.00416.39
7.4.120.0080.00916.52
7.4.110.0090.00916.56
7.4.100.0120.00616.68
7.4.90.0100.00716.56
7.4.80.0090.01319.39
7.4.70.0180.00516.59
7.4.60.0110.00716.61
7.4.50.0030.00616.73
7.4.40.0070.01116.46
7.4.30.0040.01316.75
7.4.10.0030.01415.09
7.4.00.0080.01014.95
7.3.330.0050.00013.42
7.3.320.0050.00013.44
7.3.310.0000.00716.54
7.3.300.0070.00016.46
7.3.290.0110.00416.43
7.3.280.0120.00616.45
7.3.270.0120.00617.40
7.3.260.0140.00316.64
7.3.240.0070.01416.57
7.3.230.0100.00616.39
7.3.210.0080.00816.52
7.3.200.0130.01019.39
7.3.190.0110.00816.47
7.3.180.0140.00316.67
7.3.170.0100.00716.48
7.3.160.0100.00716.65
7.3.130.0030.01614.95
7.3.120.0080.00915.50
7.3.110.0070.01015.49
7.3.100.0060.01015.40
7.3.90.0040.01015.44
7.3.80.0060.00915.54
7.3.70.0050.00915.39
7.3.60.0030.01115.35
7.3.50.0050.01015.53
7.3.40.0050.01015.45
7.3.30.0050.00615.47
7.3.20.0090.00516.70
7.3.10.0060.00816.75
7.3.00.0070.00616.78
7.2.330.0100.01616.79
7.2.320.0140.00316.48
7.2.310.0140.00416.62
7.2.300.0140.00316.66
7.2.290.0110.01116.51
7.2.260.0090.01114.80
7.2.250.0090.01115.07
7.2.240.0050.01015.56
7.2.230.0060.00815.65
7.2.220.0050.01015.51
7.2.210.0090.00715.67
7.2.200.0040.00715.61
7.2.190.0050.00915.56
7.2.180.0050.00915.49
7.2.170.0070.00615.54
7.2.160.0070.00815.57
7.2.150.0090.00516.92
7.2.140.0040.00916.99
7.2.130.0070.00716.92
7.2.120.0070.00716.89
7.2.110.0030.01016.90
7.2.100.0060.00817.04
7.2.90.0060.00816.92
7.2.80.0060.01017.07
7.2.70.0030.01117.05
7.2.60.0070.00917.02
7.2.50.0060.00916.83
7.2.40.0070.00516.93
7.2.30.0080.00617.05
7.2.20.0070.00817.02
7.2.10.0070.00917.03
7.2.00.0050.01017.54
7.1.330.0080.00716.18
7.1.320.0060.00716.17
7.1.310.0050.00816.16
7.1.300.0070.00616.10
7.1.290.0050.00916.18
7.1.280.0070.00616.21
7.1.270.0020.00816.06
7.1.260.0060.00616.09
7.1.250.0070.00716.22
7.1.240.0030.01015.88
7.1.230.0030.00815.78
7.1.220.0010.01215.77
7.1.210.0070.00415.93
7.1.200.0020.01015.77
7.1.190.0080.00615.84
7.1.180.0080.00315.95
7.1.170.0110.00315.94
7.1.160.0040.01315.69
7.1.150.0020.00815.83
7.1.140.0070.00615.71
7.1.130.0070.00715.89
7.1.120.0070.00915.73
7.1.110.0050.00815.97
7.1.100.0040.00816.50
7.1.90.0060.00915.81
7.1.80.0110.00415.77
7.1.70.0070.00816.26
7.1.60.0080.00716.85
7.1.50.0100.00716.08
7.1.40.0040.01015.63
7.1.30.0050.00915.85
7.1.20.0100.00315.63
7.1.10.0020.00815.65
7.1.00.0070.02718.09
7.0.330.0090.00315.48
7.0.320.0050.00515.34
7.0.310.0040.00615.41
7.0.300.0030.01015.45
7.0.290.0030.01115.31
7.0.280.0060.00615.58
7.0.270.0090.00215.39
7.0.260.0060.00915.29
7.0.250.0030.01115.42
7.0.240.0070.00315.42
7.0.230.0050.00915.38
7.0.220.0120.00115.52
7.0.210.0050.00615.36
7.0.200.0050.00715.82
7.0.190.0090.00515.37
7.0.180.0050.00815.34
7.0.170.0020.01415.41
7.0.160.0030.01015.45
7.0.150.0020.01015.41
7.0.140.0050.03217.69
7.0.130.0110.00215.54
7.0.120.0030.00715.35
7.0.110.0070.00615.52
7.0.100.0050.00415.40
7.0.90.0040.00915.46
7.0.80.0040.00515.20
7.0.70.0070.00615.41
7.0.60.0060.01616.90
7.0.50.0070.02516.28
7.0.40.0020.03015.67
7.0.30.0180.02615.61
7.0.20.0170.02815.64
7.0.10.0050.01815.62
7.0.00.0050.01815.77
5.6.400.0020.01214.45
5.6.390.0020.01114.34
5.6.380.0080.00614.52
5.6.370.0030.01114.53
5.6.360.0060.00414.38
5.6.350.0080.00614.43
5.6.340.0050.00814.08
5.6.330.0050.00814.17
5.6.320.0100.00314.56
5.6.310.0070.00814.39
5.6.300.0040.01014.51
5.6.290.0070.00714.39
5.6.280.0030.03016.56
5.6.270.0050.00914.29
5.6.260.0030.00914.44
5.6.250.0010.01114.36
5.6.240.0070.00714.47
5.6.230.0030.00614.16
5.6.220.0090.00214.31
5.6.210.0060.02016.48
5.6.200.0040.02315.70
5.6.190.0080.01616.53
5.6.180.0110.01816.50
5.6.170.0170.02816.32
5.6.160.0070.03016.41
5.6.150.0100.02015.77
5.6.140.0100.02515.58
5.6.130.0060.01715.70
5.6.120.0050.02116.57
5.6.110.0040.03116.64
5.6.100.0060.03616.44
5.6.90.0060.03416.63
5.6.80.0050.01816.38
5.6.70.0020.01214.29
5.6.60.0030.01214.41
5.6.50.0040.00814.20
5.6.40.0030.00914.48
5.6.30.0030.00814.29
5.6.20.0050.00814.48
5.6.10.0060.00814.20
5.6.00.0070.00414.28
5.5.380.0020.01014.52
5.5.370.0050.00514.29
5.5.360.0070.00714.37
5.5.350.0120.02116.54
5.5.340.0060.02115.62
5.5.330.0090.03116.35
5.5.320.0150.02216.33
5.5.310.0140.03216.32
5.5.300.0040.03415.54
5.5.290.0080.02515.43
5.5.280.0050.03416.39
5.5.270.0050.03416.48
5.5.260.0070.01816.41
5.5.250.0060.02216.49
5.5.240.0120.03016.16
5.5.230.0050.00814.13
5.5.220.0080.00514.26
5.5.210.0060.00614.45
5.5.200.0060.00514.26
5.5.190.0030.01014.32
5.5.180.0080.00614.19
5.5.170.0110.00214.42
5.5.160.0040.01214.17
5.5.150.0060.00714.45
5.5.140.0100.00314.48
5.5.130.0060.01214.35
5.5.120.0050.00714.29
5.5.110.0040.00514.23
5.5.100.0050.00913.98
5.5.90.0090.00514.20
5.5.80.0030.00914.22
5.5.70.0070.00714.34
5.5.60.0080.00514.20
5.5.50.0030.01014.32
5.5.40.0050.00714.23
5.5.30.0120.00314.04
5.5.20.0030.01214.24
5.5.10.0020.00814.36
5.5.00.0090.00714.10
5.4.450.0110.02014.58
5.4.440.0110.02214.50
5.4.430.0040.02514.43
5.4.420.0270.00314.54
5.4.410.0230.00514.47
5.4.400.0250.00414.31
5.4.390.0230.00414.27
5.4.380.0230.00714.24
5.4.370.0230.00414.43
5.4.360.0200.00514.35
5.4.350.0220.00714.22
5.4.340.0070.01612.04
5.4.330.0030.00811.96
5.4.320.0050.01612.13
5.4.310.0030.01712.13
5.4.300.0090.01312.04
5.4.290.0040.01912.04
5.4.280.0040.01812.14
5.4.270.0020.01912.14
5.4.260.0030.01912.18
5.4.250.0040.01712.13
5.4.240.0050.01312.15
5.4.230.0010.02112.16
5.4.220.0030.01912.02
5.4.210.0050.01612.14
5.4.200.0050.01712.14
5.4.190.0010.02012.17
5.4.180.0040.01912.09
5.4.170.0020.02112.04
5.4.160.0020.02012.16
5.4.150.0020.01812.12
5.4.140.0070.01512.08
5.4.130.0030.01612.02
5.4.120.0040.01812.05
5.4.110.0070.01411.89
5.4.100.0050.01811.91
5.4.90.0040.01711.99
5.4.80.0050.01811.96
5.4.70.0030.01712.05
5.4.60.0060.01311.95
5.4.50.0050.01612.02
5.4.40.0030.01712.02
5.4.30.0020.01711.94
5.4.20.0040.01411.93
5.4.10.0060.01511.96
5.4.00.0030.01711.77
5.3.290.0080.03612.80
5.3.280.0050.03812.71
5.3.270.0060.03812.73
5.3.260.0060.03812.72
5.3.250.0080.03512.72
5.3.240.0090.03312.72
5.3.230.0100.03912.71
5.3.220.0050.04112.68
5.3.210.0070.04112.68
5.3.200.0080.04312.68
5.3.190.0080.03412.68
5.3.180.0060.03512.68
5.3.170.0070.03412.67
5.3.160.0080.04012.67
5.3.150.0080.03812.68
5.3.140.0070.03812.66
5.3.130.0060.03712.66
5.3.120.0090.03812.65
5.3.110.0090.04012.66
5.3.100.0060.03612.13
5.3.90.0050.03812.11
5.3.80.0060.04112.09
5.3.70.0060.03712.09
5.3.60.0090.03612.08
5.3.50.0050.03712.02
5.3.40.0070.03512.02
5.3.30.0030.03611.98
5.3.20.0050.04511.77
5.3.10.0100.03311.74
5.3.00.0060.03511.72
5.2.170.0090.0289.22
5.2.160.0040.0349.22
5.2.150.0010.0419.22
5.2.140.0030.0319.21
5.2.130.0050.0279.18
5.2.120.0020.0309.18
5.2.110.0070.0269.19
5.2.100.0060.0269.18
5.2.90.0040.0299.18
5.2.80.0060.0329.18
5.2.70.0050.0299.18
5.2.60.0040.0349.13
5.2.50.0030.0319.10
5.2.40.0030.0309.07
5.2.30.0080.0299.05
5.2.20.0050.0299.04
5.2.10.0030.0318.95
5.2.00.0050.0298.81
5.1.60.0040.0238.09
5.1.50.0050.0238.08
5.1.40.0050.0238.06
5.1.30.0020.0278.42
5.1.20.0030.0288.44
5.1.10.0050.0248.17
5.1.00.0030.0268.16
5.0.50.0030.0296.64
5.0.40.0050.0176.50
5.0.30.0040.0316.31
5.0.20.0020.0206.28
5.0.10.0020.0296.26
5.0.00.0030.0326.25
4.4.90.0010.0184.78
4.4.80.0010.0174.75
4.4.70.0050.0134.75
4.4.60.0040.0134.76
4.4.50.0020.0154.77
4.4.40.0050.0254.71
4.4.30.0030.0194.76
4.4.20.0030.0154.84
4.4.10.0020.0164.85
4.4.00.0060.0224.76
4.3.110.0000.0184.67
4.3.100.0030.0144.67
4.3.90.0010.0164.64
4.3.80.0030.0234.59
4.3.70.0020.0154.63
4.3.60.0010.0174.63
4.3.50.0020.0164.63
4.3.40.0050.0234.54
4.3.30.0010.0163.30
4.3.20.0000.0173.27
4.3.10.0000.0173.24
4.3.00.0130.0137.61

preferences:
48.85 ms | 401 KiB | 5 Q