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)) { $message[$i] = ''; $count++; } } return ['message' => $message, 'replacements' => $count]; } $msg = "усский алфавит"; $tmp['message'] = ''; while ($tmp['message'] != $msg) { $tmp = stripNonValidCharaters($msg); $msg = $tmp['message']; } 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.0120.00618.43
8.3.50.0170.00421.93
8.3.40.0070.00718.64
8.3.30.0100.00319.21
8.3.20.0050.00220.34
8.3.10.0000.00823.67
8.3.00.0050.00519.45
8.2.180.0110.00416.75
8.2.170.0070.00722.96
8.2.160.0070.00720.16
8.2.150.0060.00324.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0030.00519.49
8.2.110.0120.00622.11
8.2.100.0000.01217.75
8.2.90.0000.00819.22
8.2.80.0000.00817.97
8.2.70.0130.00017.11
8.2.60.0050.00318.05
8.2.50.0030.00618.07
8.2.40.0030.00619.93
8.2.30.0070.00018.21
8.2.20.0040.00417.76
8.2.10.0060.00318.15
8.2.00.0050.00617.74
8.1.280.0070.01125.92
8.1.270.0040.00423.92
8.1.260.0060.00926.35
8.1.250.0040.00428.09
8.1.240.0000.01124.03
8.1.230.0040.00819.26
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0000.00917.23
8.1.190.0030.00517.13
8.1.180.0000.00918.10
8.1.170.0030.00518.46
8.1.160.0040.00422.04
8.1.150.0070.00018.91
8.1.140.0050.00317.48
8.1.130.0000.00717.86
8.1.120.0040.00417.40
8.1.110.0030.00517.50
8.1.100.0040.00417.41
8.1.90.0040.00417.48
8.1.80.0040.00417.46
8.1.70.0070.00017.37
8.1.60.0000.00817.61
8.1.50.0090.00017.47
8.1.40.0040.00417.49
8.1.30.0030.00617.64
8.1.20.0030.00617.58
8.1.10.0040.00417.66
8.1.00.0050.00217.58
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0040.00418.51
8.0.270.0040.00417.29
8.0.260.0030.00317.30
8.0.250.0000.00717.02
8.0.240.0030.00317.01
8.0.230.0000.00817.08
8.0.220.0050.00316.90
8.0.210.0000.00716.95
8.0.200.0060.00316.98
8.0.190.0050.00316.95
8.0.180.0070.00016.98
8.0.170.0090.00016.86
8.0.160.0040.00417.02
8.0.150.0000.00716.92
8.0.140.0070.00016.85
8.0.130.0000.00613.34
8.0.120.0000.00816.89
8.0.110.0040.00416.97
8.0.100.0000.00716.94
8.0.90.0030.00517.04
8.0.80.0060.00916.98
8.0.70.0000.00716.88
8.0.60.0080.00016.88
8.0.50.0000.00716.79
8.0.30.0130.01017.08
8.0.20.0140.00517.40
8.0.10.0050.00317.12
8.0.00.0120.00516.86
7.4.330.0000.00515.08
7.4.320.0060.00016.55
7.4.300.0000.00616.54
7.4.290.0070.00316.63
7.4.280.0040.00416.66
7.4.270.0030.00516.48
7.4.260.0040.00416.48
7.4.250.0070.00016.53
7.4.240.0020.00516.62
7.4.230.0050.00216.43
7.4.220.0100.01616.45
7.4.210.0070.00716.56
7.4.200.0000.00716.64
7.4.160.0100.00716.65
7.4.150.0060.01317.40
7.4.140.0110.00717.86
7.4.130.0110.00616.50
7.4.120.0100.00816.49
7.4.110.0170.00016.66
7.4.100.0110.00716.36
7.4.90.0060.01116.49
7.4.80.0190.00319.39
7.4.70.0130.00316.70
7.4.60.0110.00616.43
7.4.50.0080.00016.29
7.4.40.0100.01316.62
7.4.30.0130.00316.44
7.4.00.0000.01415.09
7.3.330.0030.00313.42
7.3.320.0000.00613.41
7.3.310.0000.00716.46
7.3.300.0030.00316.47
7.3.290.0090.00616.41
7.3.280.0090.00916.46
7.3.270.0030.01517.40
7.3.260.0100.00716.58
7.3.250.0000.01716.46
7.3.240.0070.01116.59
7.3.230.0080.00816.39
7.3.210.0090.00916.44
7.3.200.0150.00319.39
7.3.190.0120.00916.49
7.3.180.0100.00716.38
7.3.170.0060.01016.45
7.3.160.0090.00616.41
7.2.330.0180.00716.73
7.2.320.0150.00916.82
7.2.310.0080.01216.55
7.2.300.0150.00816.68
7.2.290.0120.00616.82
7.2.60.0070.01016.81
7.2.00.0030.00919.26
7.1.200.0030.00915.60
7.1.100.0080.00317.93
7.1.70.0040.00417.07
7.1.60.0100.01619.32
7.1.50.0120.01217.04
7.1.00.0100.07022.33
7.0.200.0070.00316.79
7.0.140.0070.07322.15
7.0.60.0330.07719.89
7.0.50.0070.07317.84
7.0.40.0070.08320.36
7.0.30.0300.06720.20
7.0.20.0270.08020.07
7.0.10.0130.06720.30
7.0.00.0000.04320.18
5.6.280.0030.07321.08
5.6.210.0100.07720.66
5.6.200.0030.05718.25
5.6.190.0030.04720.63
5.6.180.0400.07020.41
5.6.170.0430.07020.46
5.6.160.0070.08320.47
5.6.150.0030.07718.29
5.6.140.0130.07318.15
5.6.130.0030.06318.25
5.6.120.0000.08321.02
5.6.110.0070.08721.10
5.6.100.0030.09021.03
5.6.90.0070.07720.90
5.6.80.0200.06720.39
5.5.350.0270.07320.41
5.5.340.0100.07717.94
5.5.330.0030.08320.57
5.5.320.0300.07720.36
5.5.310.0100.04720.31
5.5.300.0000.05018.10
5.5.290.0030.08718.08
5.5.280.0200.06020.70
5.5.270.0030.04720.89
5.5.260.0030.04320.96
5.5.250.0170.06720.48
5.5.240.0030.07320.27
5.4.450.0300.08019.45
5.4.440.0470.05719.25
5.4.430.0570.04719.45
5.4.420.0270.05019.44
5.4.410.0300.04019.32
5.4.400.0370.06719.14
5.4.390.0470.06318.97
5.4.380.0370.06019.12
5.4.370.0200.04319.06
5.4.360.0400.03719.16
5.4.350.0430.05719.13
5.4.340.0230.05019.21
5.4.320.0430.03719.03
5.4.310.0330.07019.06
5.4.300.0430.06319.21
5.4.290.0400.05719.10
5.4.280.0300.05718.94
5.4.270.0370.07019.02
5.4.260.0370.06019.23
5.4.250.0370.06319.11
5.4.240.0400.06319.02
5.4.230.0330.06718.95
5.4.220.0270.04019.13
5.4.210.0330.06718.96
5.4.200.0400.06019.20
5.4.190.0300.05018.94
5.4.180.0400.05719.20
5.4.170.0300.04019.09
5.4.160.0330.03319.10
5.4.150.0270.04719.01
5.4.140.0230.04016.45
5.4.130.0400.05716.38
5.4.120.0430.03716.41
5.4.110.0200.04016.35
5.4.100.0200.05016.45
5.4.90.0430.05716.55
5.4.80.0330.06716.56
5.4.70.0300.04716.44
5.4.60.0270.04716.52
5.4.50.0330.05016.55
5.4.40.0400.05716.34
5.4.30.0370.06316.21
5.4.20.0330.06016.54
5.4.10.0370.05716.55
5.4.00.0370.06315.83
5.3.290.0270.04014.70
5.3.280.0430.06314.75
5.3.270.0270.08014.60
5.3.260.0270.07014.62
5.3.250.0200.04314.63
5.3.240.0230.04014.68
5.3.230.0370.06714.61
5.3.220.0200.07714.58
5.3.210.0300.07314.59
5.3.200.0370.03714.57
5.3.190.0270.05314.49
5.3.180.0330.04714.71
5.3.170.0370.06714.56
5.3.160.0330.05714.60
5.3.150.0270.07014.56
5.3.140.0270.04714.63
5.3.130.0370.06714.61
5.3.120.0330.04714.60
5.3.110.0330.07014.54
5.3.100.0330.07014.07
5.3.90.0370.06714.07
5.3.80.0300.07014.05
5.3.70.0300.04014.04
5.3.60.0370.06714.02
5.3.50.0370.03713.95
5.3.40.0300.06313.94
5.3.30.0200.03713.91
5.3.20.0270.03713.84
5.3.10.0230.04013.68
5.3.00.0270.03013.68
5.2.170.0270.05711.20
5.2.160.0230.04311.15
5.2.150.0270.02711.23
5.2.140.0170.02711.15
5.2.130.0200.02711.10
5.2.120.0170.03011.25
5.2.110.0200.02711.25
5.2.100.0200.02711.10
5.2.90.0130.03011.25
5.2.80.0230.02310.98
5.2.70.0200.02311.06
5.2.60.0130.03011.05
5.2.50.0100.03311.16
5.2.40.0170.02711.03
5.2.30.0130.02710.92
5.2.20.0230.02711.02
5.2.10.0170.03011.02
5.2.00.0170.03010.71
5.1.60.0230.01710.04
5.1.50.0130.02710.04
5.1.40.0100.02710.12
5.1.30.0200.02010.50
5.1.20.0100.03010.27
5.1.10.0130.0309.98
5.1.00.0200.02310.04
5.0.50.0100.0178.56
5.0.40.0100.0178.47
5.0.30.0070.0308.24
5.0.20.0070.0238.24
5.0.10.0100.0178.24
5.0.00.0070.0438.24
4.4.90.0070.0178.24
4.4.80.0030.0178.24
4.4.70.0070.0138.24
4.4.60.0030.0178.24
4.4.50.0070.0208.24
4.4.40.0070.0278.24
4.4.30.0030.0178.24
4.4.20.0070.0138.24
4.4.10.0030.0178.24
4.4.00.0070.0238.24
4.3.110.0070.0138.24
4.3.100.0070.0138.24
4.3.90.0070.0138.24
4.3.80.0030.0278.24
4.3.70.0030.0178.24
4.3.60.0030.0208.24
4.3.50.0030.0178.24
4.3.40.0070.0238.24
4.3.30.0030.0138.24
4.3.20.0030.0138.24
4.3.10.0030.0178.24
4.3.00.0030.0178.24

preferences:
57.89 ms | 401 KiB | 5 Q