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(hexdec(bin2hex(mb_substr($message, $i, 1))), $validGSMKeycodes, true)) { $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(hexdec(bin2hex(mb_substr($message, $i, 1)))); }

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.00918.68
8.3.50.0100.01018.21
8.3.40.0040.01118.78
8.3.30.0140.00019.09
8.3.20.0070.00020.34
8.3.10.0060.00323.51
8.3.00.0090.00317.75
8.2.180.0070.00716.63
8.2.170.0040.01219.13
8.2.160.0070.00722.96
8.2.150.0030.00524.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00020.59
8.2.110.0100.00722.08
8.2.100.0080.00417.63
8.2.90.0000.00719.18
8.2.80.0040.00417.97
8.2.70.0000.01017.50
8.2.60.0050.00317.89
8.2.50.0030.00518.07
8.2.40.0040.00419.75
8.2.30.0020.00518.19
8.2.20.0060.00317.77
8.2.10.0050.00318.20
8.2.00.0030.00717.70
8.1.280.0160.00325.92
8.1.270.0040.00423.96
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0050.00524.03
8.1.230.0120.00017.42
8.1.220.0030.00617.78
8.1.210.0030.00618.77
8.1.200.0080.00017.35
8.1.190.0040.00417.36
8.1.180.0080.00018.10
8.1.170.0000.00818.66
8.1.160.0040.00422.02
8.1.150.0030.00518.86
8.1.140.0040.00417.36
8.1.130.0000.00717.84
8.1.120.0000.00717.48
8.1.110.0040.00417.48
8.1.100.0030.00317.48
8.1.90.0070.00017.37
8.1.80.0000.00717.36
8.1.70.0030.00317.40
8.1.60.0000.00817.49
8.1.50.0000.00817.54
8.1.40.0040.00417.53
8.1.30.0040.00417.76
8.1.20.0000.00817.62
8.1.10.0000.00717.59
8.1.00.0050.00217.57
8.0.300.0000.00818.77
8.0.290.0030.00616.75
8.0.280.0030.00318.40
8.0.270.0070.00017.34
8.0.260.0000.00617.25
8.0.250.0070.00017.09
8.0.240.0000.00717.12
8.0.230.0030.00317.11
8.0.220.0070.00017.05
8.0.210.0000.00717.00
8.0.200.0070.00417.13
8.0.190.0080.00017.16
8.0.180.0040.00417.05
8.0.170.0000.00816.96
8.0.160.0000.00717.09
8.0.150.0000.00717.07
8.0.140.0050.00316.98
8.0.130.0000.00513.48
8.0.120.0040.00417.02
8.0.110.0000.00717.01
8.0.100.0070.00016.93
8.0.90.0000.00717.08
8.0.80.0060.00917.00
8.0.70.0000.00717.03
8.0.60.0000.00717.09
8.0.50.0070.00016.90
8.0.30.0100.01017.09
8.0.20.0090.00917.40
8.0.10.0000.00717.14
8.0.00.0020.01516.93
7.4.330.0000.00515.00
7.4.320.0000.00716.60
7.4.300.0000.00616.68
7.4.290.0000.00716.63
7.4.280.0030.00616.65
7.4.270.0070.00016.42
7.4.260.0040.00416.53
7.4.250.0050.00316.63
7.4.240.0040.00316.55
7.4.230.0000.00816.62
7.4.220.0090.00916.66
7.4.210.0120.00316.71
7.4.200.0000.00716.64
7.4.160.0070.01016.55
7.4.150.0100.01017.40
7.4.140.0110.02517.86
7.4.130.0120.01216.58
7.4.120.0090.01016.60
7.4.110.0090.01016.73
7.4.100.0120.00616.52
7.4.90.0070.01116.54
7.4.80.0120.00719.39
7.4.70.0100.01116.69
7.4.60.0100.00716.41
7.4.50.0040.00416.48
7.4.40.0040.01516.53
7.4.30.0110.00616.53
7.4.10.0100.01015.22
7.4.00.0070.01014.96
7.3.330.0050.00013.48
7.3.320.0050.00013.37
7.3.310.0000.00716.30
7.3.300.0040.00416.49
7.3.290.0090.00616.46
7.3.280.0080.00716.48
7.3.270.0110.01117.40
7.3.260.0060.01216.40
7.3.240.0110.00616.57
7.3.230.0110.00616.52
7.3.210.0040.01516.30
7.3.200.0150.00419.39
7.3.190.0140.00716.68
7.3.180.0100.00816.43
7.3.170.0060.01216.66
7.3.160.0140.00316.68
7.3.130.0030.01614.95
7.3.120.0150.00514.95
7.3.110.0070.01114.90
7.3.100.0040.01214.96
7.3.90.0050.01014.89
7.3.80.0060.00914.87
7.3.70.0070.00315.01
7.3.60.0060.00814.88
7.3.50.0050.00514.82
7.3.40.0040.00814.92
7.3.30.0060.00914.83
7.3.20.0060.00916.61
7.3.10.0060.00416.65
7.3.00.0070.00716.66
7.2.330.0160.00916.81
7.2.320.0110.01116.81
7.2.310.0030.02016.79
7.2.300.0110.00616.43
7.2.290.0070.01316.58
7.2.260.0030.01415.19
7.2.250.0060.01515.08
7.2.240.0030.01315.20
7.2.230.0070.01115.01
7.2.220.0010.01515.28
7.2.210.0030.01415.19
7.2.200.0060.00714.98
7.2.190.0050.01014.92
7.2.180.0100.00415.13
7.2.170.0030.01315.02
7.2.160.0090.00615.36
7.2.150.0060.00617.02
7.2.140.0100.00617.16
7.2.130.0040.01116.81
7.2.120.0080.01116.85
7.2.110.0070.00316.63
7.2.100.0060.00916.71
7.2.90.0060.00916.80
7.2.80.0030.00716.71
7.2.70.0040.01117.02
7.2.60.0050.00816.92
7.2.50.0120.00617.06
7.2.40.0030.01016.87
7.2.30.0040.01117.06
7.2.20.0100.00616.83
7.2.10.0090.00316.95
7.2.00.0070.00718.13
7.1.330.0070.00815.79
7.1.320.0050.01015.98
7.1.310.0050.01115.86
7.1.300.0060.00915.84
7.1.290.0070.00815.78
7.1.280.0060.00815.74
7.1.270.0050.01115.77
7.1.260.0060.00715.77
7.1.250.0030.01215.54
7.1.240.0070.00715.91
7.1.230.0030.00615.72
7.1.220.0080.00415.95
7.1.210.0040.00815.77
7.1.200.0020.01215.81
7.1.190.0050.00315.93
7.1.180.0070.00715.89
7.1.170.0060.00715.77
7.1.160.0070.00715.90
7.1.150.0040.00715.88
7.1.140.0040.01115.76
7.1.130.0030.00715.91
7.1.120.0070.00715.46
7.1.110.0030.00715.94
7.1.100.0080.00316.96
7.1.90.0060.00615.84
7.1.80.0030.00715.92
7.1.70.0080.00316.67
7.1.60.0130.00817.53
7.1.50.0060.01116.38
7.1.40.0060.00615.45
7.1.30.0030.01015.89
7.1.20.0040.00815.93
7.1.10.0030.01015.52
7.1.00.0050.03919.14
7.0.330.0060.00915.43
7.0.320.0030.01115.43
7.0.310.0030.00715.58
7.0.300.0060.00615.52
7.0.290.0040.00815.50
7.0.280.0060.00615.49
7.0.270.0070.00315.59
7.0.260.0070.00315.52
7.0.250.0030.00715.31
7.0.240.0040.00815.63
7.0.230.0110.00315.32
7.0.220.0040.00815.25
7.0.210.0040.01115.37
7.0.200.0050.00516.08
7.0.190.0030.01015.53
7.0.180.0060.00815.48
7.0.170.0030.00515.53
7.0.160.0000.00815.48
7.0.150.0060.00615.57
7.0.140.0050.04318.73
7.0.130.0030.01015.45
7.0.120.0090.00315.32
7.0.110.0080.00015.26
7.0.100.0110.00315.52
7.0.90.0080.00615.16
7.0.80.0080.00315.39
7.0.70.0040.01115.63
7.0.60.0120.04618.70
7.0.50.0110.02216.72
7.0.40.0100.02516.76
7.0.30.0300.02716.88
7.0.20.0170.03916.95
7.0.10.0040.02616.90
7.0.00.0070.03916.87
5.6.400.0050.00514.46
5.6.390.0060.00914.43
5.6.380.0060.00914.08
5.6.370.0030.00714.41
5.6.360.0030.00614.06
5.6.350.0030.00514.40
5.6.340.0070.00714.63
5.6.330.0090.00314.28
5.6.320.0090.00314.55
5.6.310.0090.00614.57
5.6.300.0100.00314.71
5.6.290.0040.01114.81
5.6.280.0080.03717.59
5.6.270.0000.01414.32
5.6.260.0100.00314.56
5.6.250.0060.00814.33
5.6.240.0040.00814.68
5.6.230.0070.00714.30
5.6.220.0070.00714.43
5.6.210.0110.04317.38
5.6.200.0040.04216.18
5.6.190.0030.02817.54
5.6.180.0120.02317.46
5.6.170.0220.04117.51
5.6.160.0000.03817.45
5.6.150.0090.04116.27
5.6.140.0080.04316.24
5.6.130.0080.02816.26
5.6.120.0070.03117.58
5.6.110.0070.04017.64
5.6.100.0030.04217.73
5.6.90.0100.04217.63
5.6.80.0080.02317.37
5.6.70.0080.00414.35
5.6.60.0030.00614.25
5.6.50.0080.00014.46
5.6.40.0030.00614.14
5.6.30.0040.00814.21
5.6.20.0030.01014.46
5.6.10.0080.00414.34
5.6.00.0040.01114.38
5.5.380.0100.00314.27
5.5.370.0090.00914.30
5.5.360.0000.01014.33
5.5.350.0100.04217.40
5.5.340.0040.04116.18
5.5.330.0030.02717.34
5.5.320.0200.03117.42
5.5.310.0240.04017.43
5.5.300.0030.02316.19
5.5.290.0020.02816.26
5.5.280.0100.04017.65
5.5.270.0030.03917.54
5.5.260.0000.02817.40
5.5.250.0050.03117.51
5.5.240.0070.02817.16
5.5.230.0070.00414.43
5.5.220.0030.01014.29
5.5.210.0090.00414.03
5.5.200.0070.00714.45
5.5.190.0070.01014.49
5.5.180.0030.00614.13
5.5.170.0070.00714.39
5.5.160.0100.00714.15
5.5.150.0000.01214.11
5.5.140.0030.00514.20
5.5.130.0030.00714.43
5.5.120.0050.00514.02
5.5.110.0000.01414.62
5.5.100.0070.01014.48
5.5.90.0000.00914.33
5.5.80.0000.00914.34
5.5.70.0030.00914.19
5.5.60.0030.00914.37
5.5.50.0030.00714.45
5.5.40.0030.01014.12
5.5.30.0030.01214.43
5.5.20.0000.00814.57
5.5.10.0060.00914.40
5.5.00.0050.00514.20
5.4.450.0530.03315.43
5.4.440.0420.03315.53
5.4.430.0380.02815.48
5.4.420.0380.00315.42
5.4.410.0330.00315.36
5.4.400.0380.00515.24
5.4.390.0330.00315.25
5.4.380.0350.00315.24
5.4.370.0330.00315.25
5.4.360.0360.00015.27
5.4.350.0390.00015.28
5.4.340.0090.01711.73
5.4.330.0060.00611.41
5.4.320.0060.02011.97
5.4.310.0040.02711.97
5.4.300.0030.02411.97
5.4.290.0040.02211.97
5.4.280.0090.02111.92
5.4.270.0040.02411.91
5.4.260.0040.02211.92
5.4.250.0070.03011.91
5.4.240.0050.02411.91
5.4.230.0050.02811.91
5.4.220.0040.02411.91
5.4.210.0080.02111.91
5.4.200.0080.02111.91
5.4.190.0050.02411.91
5.4.180.0050.02111.91
5.4.170.0070.02011.91
5.4.160.0060.02211.91
5.4.150.0070.02411.91
5.4.140.0040.02611.78
5.4.130.0050.02211.75
5.4.120.0060.02111.73
5.4.110.0040.02311.72
5.4.100.0040.02911.72
5.4.90.0030.02611.72
5.4.80.0060.02411.72
5.4.70.0050.02211.72
5.4.60.0060.02111.72
5.4.50.0050.02411.72
5.4.40.0060.01911.71
5.4.30.0050.02111.71
5.4.20.0050.02211.71
5.4.10.0060.01811.71
5.4.00.0080.01911.46
5.3.290.0080.03912.80
5.3.280.0090.03812.70
5.3.270.0070.03812.73
5.3.260.0100.03912.72
5.3.250.0060.03812.72
5.3.240.0050.04112.72
5.3.230.0060.03912.70
5.3.220.0100.03712.68
5.3.210.0080.03712.68
5.3.200.0060.04412.68
5.3.190.0040.04512.67
5.3.180.0050.04012.68
5.3.170.0080.03612.67
5.3.160.0080.04112.68
5.3.150.0070.03812.67
5.3.140.0070.03412.66
5.3.130.0050.03912.66
5.3.120.0060.03912.66
5.3.110.0070.03812.66
5.3.100.0100.03512.13
5.3.90.0080.03712.11
5.3.80.0060.04212.09
5.3.70.0110.03312.09
5.3.60.0070.03812.08
5.3.50.0080.04912.02
5.3.40.0080.03512.02
5.3.30.0030.03812.00
5.3.20.0040.03711.76
5.3.10.0070.03411.73
5.3.00.0050.04611.71
5.2.170.0040.0329.22
5.2.160.0030.0329.22
5.2.150.0070.0289.22
5.2.140.0030.0329.21
5.2.130.0070.0289.18
5.2.120.0060.0369.18
5.2.110.0080.0279.19
5.2.100.0050.0349.18
5.2.90.0060.0319.18
5.2.80.0040.0349.18
5.2.70.0070.0319.18
5.2.60.0060.0339.13
5.2.50.0050.0309.10
5.2.40.0040.0309.07
5.2.30.0070.0319.05
5.2.20.0060.0309.04
5.2.10.0060.0318.95
5.2.00.0060.0338.81
5.1.60.0050.0258.09
5.1.50.0030.0268.08
5.1.40.0050.0248.06
5.1.30.0050.0268.42
5.1.20.0080.0258.44
5.1.10.0070.0248.17
5.1.00.0050.0258.16
5.0.50.0050.0246.64
5.0.40.0080.0396.50
5.0.30.0100.0386.32
5.0.20.0100.0146.28
5.0.10.0050.0226.26
5.0.00.0050.0396.25
4.4.90.0030.0184.78
4.4.80.0040.0184.75
4.4.70.0040.0184.75
4.4.60.0000.0204.76
4.4.50.0060.0344.77
4.4.40.0060.0254.71
4.4.30.0010.0174.76
4.4.20.0060.0134.84
4.4.10.0010.0194.85
4.4.00.0010.0264.76
4.3.110.0020.0204.67
4.3.100.0040.0194.66
4.3.90.0060.0124.63
4.3.80.0010.0274.59
4.3.70.0020.0234.63
4.3.60.0030.0174.63
4.3.50.0030.0184.62
4.3.40.0030.0264.53
4.3.30.0030.0153.30
4.3.20.0040.0173.28
4.3.10.0020.0173.24
4.3.00.0170.0238.11

preferences:
57.79 ms | 400 KiB | 5 Q