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 = "pусский алфавит"; $tmp['message'] = ''; while ($tmp['message'] != $msg) { $tmp = stripNonValidCharaters($msg); $msg = $tmp['message']; } var_dump($msg); for($i = 0; $i < strlen($msg); $i++) { var_dump(ord($msg[$i])); }

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.0150.00018.56
8.3.50.0070.01422.12
8.3.40.0140.00318.85
8.3.30.0120.00319.04
8.3.20.0070.00020.04
8.3.10.0000.00723.48
8.3.00.0030.00719.51
8.2.180.0060.01516.88
8.2.170.0110.00422.96
8.2.160.0140.00020.26
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00422.14
8.2.110.0100.00019.18
8.2.100.0090.00317.66
8.2.90.0000.00919.30
8.2.80.0040.00417.97
8.2.70.0100.00017.75
8.2.60.0050.00318.05
8.2.50.0060.00318.07
8.2.40.0080.00020.05
8.2.30.0020.00518.01
8.2.20.0070.00017.67
8.2.10.0080.00018.04
8.2.00.0070.00317.70
8.1.280.0110.00725.92
8.1.270.0080.00023.91
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0000.00923.80
8.1.230.0040.00719.13
8.1.220.0030.00517.79
8.1.210.0080.00018.77
8.1.200.0040.00517.35
8.1.190.0030.00617.36
8.1.180.0000.00818.10
8.1.170.0030.00518.71
8.1.160.0000.00822.04
8.1.150.0000.00818.79
8.1.140.0000.00717.39
8.1.130.0030.00317.80
8.1.120.0050.00217.46
8.1.110.0000.00817.45
8.1.100.0040.00417.52
8.1.90.0040.00417.47
8.1.80.0070.00017.48
8.1.70.0070.00017.39
8.1.60.0000.00817.61
8.1.50.0000.00817.57
8.1.40.0030.00517.59
8.1.30.0050.00317.66
8.1.20.0000.00817.66
8.1.10.0080.00017.65
8.1.00.0080.00017.36
8.0.300.0040.00418.77
8.0.290.0000.00916.75
8.0.280.0000.00718.42
8.0.270.0000.00717.18
8.0.260.0000.00617.19
8.0.250.0070.00016.98
8.0.240.0030.00316.90
8.0.230.0070.00017.02
8.0.220.0020.00516.94
8.0.210.0030.00316.92
8.0.200.0070.00317.04
8.0.190.0050.00317.03
8.0.180.0070.00016.89
8.0.170.0040.00416.95
8.0.160.0020.00516.98
8.0.150.0040.00416.97
8.0.140.0040.00416.82
8.0.130.0060.00013.44
8.0.120.0050.00316.83
8.0.110.0040.00416.87
8.0.100.0000.00716.84
8.0.90.0000.00716.92
8.0.80.0100.00716.95
8.0.70.0000.00717.00
8.0.60.0000.00816.76
8.0.50.0000.00816.79
8.0.30.0090.01217.17
8.0.20.0080.01117.40
8.0.10.0080.00017.05
8.0.00.0050.01216.80
7.4.330.0060.00015.00
7.4.320.0060.00016.62
7.4.300.0030.00316.52
7.4.290.0040.00416.61
7.4.280.0040.00416.55
7.4.270.0030.00316.59
7.4.260.0000.00816.46
7.4.250.0040.00416.52
7.4.240.0040.00416.50
7.4.230.0000.00716.26
7.4.220.0170.01016.64
7.4.210.0000.01416.55
7.4.200.0030.00316.64
7.4.160.0030.01316.46
7.4.150.0110.00817.40
7.4.140.0130.00517.86
7.4.130.0060.01216.61
7.4.120.0110.00716.50
7.4.110.0140.00316.66
7.4.100.0070.01116.49
7.4.90.0040.01316.58
7.4.80.0140.00319.39
7.4.70.0030.01516.48
7.4.60.0190.00316.44
7.4.50.0030.00516.54
7.4.40.0130.00516.36
7.4.30.0110.00616.68
7.4.00.0070.01115.17
7.3.330.0070.00013.31
7.3.320.0030.00313.45
7.3.310.0070.00016.49
7.3.300.0070.00016.45
7.3.290.0030.01016.45
7.3.280.0060.01016.40
7.3.270.0180.00017.40
7.3.260.0170.00016.38
7.3.240.0090.00916.46
7.3.230.0070.01016.57
7.3.210.0070.01016.38
7.3.200.0060.02019.39
7.3.190.0040.01716.38
7.3.180.0100.00716.57
7.3.170.0090.00916.50
7.3.160.0030.01316.38
7.3.120.0030.01214.77
7.3.110.0040.01415.00
7.3.100.0100.00314.91
7.3.90.0100.01014.79
7.3.80.0050.00514.73
7.3.70.0000.01515.06
7.3.60.0060.00915.00
7.3.50.0090.00614.82
7.3.40.0100.00314.83
7.3.30.0040.01115.00
7.3.20.0090.00616.39
7.3.10.0030.01316.41
7.3.00.0070.01016.77
7.2.330.0070.01416.40
7.2.320.0070.01016.70
7.2.310.0100.01316.48
7.2.300.0100.01416.83
7.2.290.0070.01316.57
7.2.250.0090.00915.18
7.2.240.0130.00714.97
7.2.230.0090.00614.98
7.2.220.0100.00714.96
7.2.210.0070.01015.20
7.2.200.0030.01015.25
7.2.190.0110.00714.69
7.2.180.0080.00815.21
7.2.170.0060.01315.09
7.2.60.0030.00916.77
7.1.330.0070.01015.48
7.1.320.0110.00715.62
7.1.310.0100.00615.79
7.1.300.0060.01015.84
7.1.290.0030.01015.59
7.1.280.0060.00315.68
7.1.270.0060.00915.60
7.1.260.0070.00715.80
7.1.200.0040.00415.86
7.1.100.0000.01118.30
7.1.70.0030.00617.16
7.1.60.0000.01619.32
7.1.50.0030.02117.02
7.1.00.0100.07022.35
7.0.200.0030.00616.94
7.0.140.0000.07721.96
7.0.110.0400.06020.03
7.0.100.0530.04320.13
7.0.90.0500.08319.91
7.0.80.0270.04020.06
7.0.70.0530.06719.92
7.0.60.0430.04319.69
7.0.50.0570.07020.02
7.0.40.0030.07019.88
7.0.30.0130.03319.73
7.0.20.0070.07319.82
7.0.10.0100.07719.73
7.0.00.0030.08019.66
5.6.280.0070.07020.88
5.6.260.0030.08720.64
5.6.250.0070.07720.75
5.6.240.0000.05720.63
5.6.230.0070.03720.56
5.6.220.0100.06020.66
5.6.210.0030.07720.67
5.6.200.0170.07320.66
5.6.190.0070.04320.64
5.6.180.0030.07020.64
5.6.170.0070.07020.65
5.6.160.0070.03320.68
5.6.150.0130.03720.67
5.6.140.0030.06320.87
5.6.130.0000.04720.70
5.6.120.0000.09020.68
5.6.110.0070.06020.63
5.6.100.0000.04020.64
5.6.90.0100.03020.59
5.6.80.0070.07320.02
5.6.70.0000.05320.03
5.6.60.0070.07320.02
5.6.50.0070.06719.86
5.6.40.0070.03319.84
5.6.30.0030.04020.23
5.6.20.0100.07719.99
5.6.10.0070.07320.08
5.6.00.0070.08020.02
5.5.380.0100.07717.61
5.5.370.0070.03017.55
5.5.360.0030.07717.58
5.5.350.0000.08717.66
5.5.340.0100.05317.93
5.5.330.0130.03718.07
5.5.320.0070.07018.07
5.5.310.0030.07017.93
5.5.300.0030.04018.09
5.5.290.0000.04017.91
5.5.280.0000.09018.13
5.5.270.0070.03018.21
5.5.260.0070.07718.22
5.5.250.0100.06717.65
5.5.240.0070.07017.52
5.5.230.0030.08017.60
5.5.220.0070.05717.51
5.5.210.0000.05717.31
5.5.200.0070.07017.58
5.5.190.0200.06017.27
5.5.180.0030.08317.55
5.5.160.0030.04717.58
5.5.150.0030.06317.28
5.5.140.0100.07317.43
5.5.130.0030.08017.26
5.5.120.0070.03717.57
5.5.110.0030.07317.57
5.5.100.0070.06017.17
5.5.90.0070.05717.47
5.5.80.0030.05317.29
5.5.70.0130.06717.37
5.5.60.0070.07317.34
5.5.50.0100.06317.49
5.5.40.0100.07017.08
5.5.30.0030.07017.37
5.5.20.0070.06017.46
5.5.10.0030.03717.17
5.5.00.0000.04017.44
5.4.450.0000.04319.47
5.4.440.0030.07019.52
5.4.430.0070.07019.31
5.4.420.0000.04319.33
5.4.410.0030.03719.20
5.4.400.0130.05718.99
5.4.390.0070.06319.34
5.4.380.0070.04719.32
5.4.370.0170.06719.34
5.4.360.0000.03719.14
5.4.350.0100.04319.03
5.4.340.0100.07319.01
5.4.320.0030.03719.31
5.4.310.0030.04718.98
5.4.300.0130.06019.18
5.4.290.0000.05719.17
5.4.280.0100.07719.00
5.4.270.0030.08319.18
5.4.260.0030.06019.14
5.4.250.0000.04719.25
5.4.240.0030.06719.33
5.4.230.0030.05018.98
5.4.220.0030.07719.01
5.4.210.0000.06319.18
5.4.200.0030.07319.33
5.4.190.0100.04019.17
5.4.180.0100.07019.02
5.4.170.0030.03719.32
5.4.160.0000.04018.99
5.4.150.0030.04019.17
5.4.140.0000.04016.57
5.4.130.0070.03316.54
5.4.120.0030.03316.53
5.4.110.0030.03316.59
5.4.100.0000.03316.50
5.4.90.0000.03716.43
5.4.80.0030.03016.55
5.4.70.0100.06716.57
5.4.60.0030.07316.54
5.4.50.0100.04716.46
5.4.40.0000.04016.29
5.4.30.0030.04316.48
5.4.20.0030.04016.53
5.4.10.0070.03716.26
5.4.00.0000.03716.00
5.3.290.0030.06014.53
5.3.280.0170.05314.72
5.3.270.0030.04014.61
5.3.260.0070.04714.56
5.3.250.0000.04014.75
5.3.240.0000.04014.59
5.3.230.0070.03014.64
5.3.220.0100.03014.56
5.3.210.0070.03014.43
5.3.200.0070.03714.43
5.3.190.0030.03314.71
5.3.180.0070.02714.56
5.3.170.0030.03014.70
5.3.160.0030.03314.56
5.3.150.0030.07314.79
5.3.140.0030.07314.65
5.3.130.0030.04714.51
5.3.120.0030.06314.54
5.3.110.0100.02714.56
5.3.100.0070.03314.00
5.3.90.0000.05314.00
5.3.80.0100.05014.02
5.3.70.0100.03014.14
5.3.60.0030.03713.95
5.3.50.0000.03314.09
5.3.40.0000.04013.98
5.3.30.0000.03313.96
5.3.20.0030.03313.71
5.3.10.0030.03313.73
5.3.00.0000.04013.64
5.2.170.0130.01711.96
5.2.160.0000.03011.96
5.2.150.0000.02711.96
5.2.140.0070.02711.96
5.2.130.0030.02711.96
5.2.120.0000.03011.96
5.2.110.0030.02711.96
5.2.100.0000.02711.96
5.2.90.0030.02311.96
5.2.80.0070.02311.96
5.2.70.0000.03011.96
5.2.60.0000.03311.96
5.2.50.0030.02711.96
5.2.40.0000.03011.96
5.2.30.0030.02311.96
5.2.20.0100.02011.96
5.2.10.0000.03011.96
5.2.00.0030.02311.96
5.1.60.0000.02711.96
5.1.50.0070.01711.96
5.1.40.0000.02711.96
5.1.30.0070.02011.96
5.1.20.0070.02011.96
5.1.10.0000.02711.96
5.1.00.0000.02711.96
5.0.50.0000.02011.96
5.0.40.0030.02011.96
5.0.30.0030.03011.96
5.0.20.0000.02011.96
5.0.10.0000.02011.96
5.0.00.0030.02311.96
4.4.90.0000.01711.96
4.4.80.0030.01311.96
4.4.70.0000.01711.96
4.4.60.0000.01711.96
4.4.50.0070.01011.96
4.4.40.0000.02711.96
4.4.30.0000.02011.96
4.4.20.0030.01311.96
4.4.10.0000.01711.96
4.4.00.0030.02311.96
4.3.110.0000.01311.96
4.3.100.0000.01311.96
4.3.90.0000.01311.96
4.3.80.0030.02011.96
4.3.70.0030.01311.96
4.3.60.0000.01311.96
4.3.50.0000.01711.96
4.3.40.0000.02011.96
4.3.30.0030.01011.96
4.3.20.0030.01011.96
4.3.10.0000.01711.96
4.3.00.0000.01311.96

preferences:
43.87 ms | 401 KiB | 5 Q