3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = "\xC2°Freen\x18 ew°\x90ɮ\x7F\xA0\xC2 \xc2blabla"; //$result="a\xC2"; ini_set('mbstring.substitute_character', "none"); echo mb_convert_encoding($result, 'UTF-8', 'UTF-8'); exit; $result = preg_replace('~[\x{0000}-\x{000F}\x{007F}-\x{00a0}]~', '', $result); echo @iconv("UTF-8", "UTF-8//IGNORE", $result); exit; $result = preg_replace('~[\x{0000}-\x{000F}\x{007F}-\x{00a0}]~', '?', $result); $string = "°Freen\x18 ew°\x90ɮ\x7F\xc2"; $string = preg_replace("#[\x09\x0A\x0D\x20-\x7E]#" ,"",$string); // ASCII $string = preg_replace("#[\xC2-\xDF][\x80-\xBF]#" ,"",$string); // non-overlong 2-byte $string = preg_replace("#\xE0[\xA0-\xBF][\x80-\xBF]#" ,"",$string); // excluding overlongs $string = preg_replace("#[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}#","",$string); // straight 3-byte $string = preg_replace("#\xED[\x80-\x9F][\x80-\xBF]#" ,"",$string); // excluding surrogates $string = preg_replace("#\xF0[\x90-\xBF][\x80-\xBF]{2}#","",$string); // planes 1-3 $string = preg_replace("#[\xF1-\xF3][\x80-\xBF]{3}#" ,"",$string); // planes 4-15 $string = preg_replace("#\xF4[\x80-\x8F][\x80-\xBF]{2}#","",$string); // plane 16 //reject overly long 2 byte sequences, as well as characters above U+10000 and replace with ? $result= preg_replace( '/[\xC2-\xDF]((?![\x80-\xBF])|[\x80-\xBF]{2,})/S', '', $result ); if($result == "\xC2") echo 'fuck'; echo $result;

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.70.0180.00018.29
8.3.60.0170.00318.30
8.3.50.0130.00721.90
8.3.40.0100.00718.83
8.3.30.0140.00018.84
8.3.20.0000.00818.61
8.3.10.0080.00020.92
8.3.00.0020.00523.71
8.2.180.0090.01216.88
8.2.170.0070.00722.96
8.2.160.0110.00420.47
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0080.00019.64
8.2.110.0040.00420.41
8.2.100.0070.00417.84
8.2.90.0030.00519.09
8.2.80.0000.00717.97
8.2.70.0030.00617.50
8.2.60.0030.00617.80
8.2.50.0080.00018.07
8.2.40.0050.00318.11
8.2.30.0040.00419.40
8.2.20.0030.00517.67
8.2.10.0000.00817.79
8.2.00.0040.00417.79
8.1.280.0110.01125.92
8.1.270.0040.00423.99
8.1.260.0130.00326.35
8.1.250.0060.00328.09
8.1.240.0090.00022.61
8.1.230.0110.00020.84
8.1.220.0040.00418.77
8.1.210.0030.00518.77
8.1.200.0030.00617.22
8.1.190.0000.00717.54
8.1.180.0040.00418.10
8.1.170.0060.00318.59
8.1.160.0000.00818.93
8.1.150.0040.00418.61
8.1.140.0060.00317.43
8.1.130.0000.00717.87
8.1.120.0030.00417.43
8.1.110.0070.00317.49
8.1.100.0040.00417.57
8.1.90.0050.00217.49
8.1.80.0000.00817.41
8.1.70.0030.00317.47
8.1.60.0030.00617.64
8.1.50.0000.00917.58
8.1.40.0040.00417.68
8.1.30.0040.00417.78
8.1.20.0040.00417.71
8.1.10.0000.00717.54
8.1.00.0000.00717.51
8.0.300.0040.00420.18
8.0.290.0040.00317.30
8.0.280.0030.00318.61
8.0.270.0070.00017.36
8.0.260.0090.00016.89
8.0.250.0000.00717.00
8.0.240.0060.00317.05
8.0.230.0070.00016.94
8.0.220.0000.00716.93
8.0.210.0040.00417.00
8.0.200.0000.00617.07
8.0.190.0070.00016.93
8.0.180.0000.00717.02
8.0.170.0040.00417.06
8.0.160.0000.00716.87
8.0.150.0080.00016.90
8.0.140.0000.01217.00
8.0.130.0070.00013.45
8.0.120.0040.00416.84
8.0.110.0040.00316.87
8.0.100.0000.00816.85
8.0.90.0000.00716.99
8.0.80.0130.00616.88
8.0.70.0040.00416.98
8.0.60.0080.00016.94
8.0.50.0080.00016.87
8.0.30.0110.00817.24
8.0.20.0120.00617.40
8.0.10.0000.00717.01
8.0.00.0100.00916.80
7.4.330.0060.00013.43
7.4.320.0090.00016.60
7.4.300.0000.00616.55
7.4.290.0030.00316.58
7.4.280.0030.00316.58
7.4.270.0040.00416.57
7.4.260.0050.00013.38
7.4.250.0040.00416.52
7.4.240.0030.00316.45
7.4.230.0000.00716.46
7.4.220.0070.01116.59
7.4.210.0070.00916.59
7.4.200.0000.00716.36
7.4.190.0040.00416.50
7.4.160.0100.00616.65
7.4.150.0170.00017.40
7.4.140.0080.01017.86
7.4.130.0080.00916.55
7.4.120.0090.00816.56
7.4.110.0060.01116.61
7.4.100.0120.00616.48
7.4.90.0070.01016.70
7.4.80.0140.00719.39
7.4.70.0120.00516.59
7.4.60.0120.00516.52
7.4.50.0040.00916.35
7.4.40.0050.01119.34
7.4.30.0070.01716.41
7.4.20.0060.01216.55
7.4.10.0120.00516.49
7.4.00.0050.00915.56
7.3.330.0000.00513.21
7.3.320.0020.00213.13
7.3.310.0030.00316.14
7.3.300.0000.00716.32
7.3.290.0090.00516.23
7.3.280.0120.00616.32
7.3.270.0060.01817.40
7.3.260.0100.00618.24
7.3.250.0100.01116.34
7.3.240.0060.01016.52
7.3.230.0130.00316.39
7.3.210.0040.01216.28
7.3.200.0150.00016.27
7.3.190.0120.00716.26
7.3.180.0090.00916.22
7.3.170.0090.00916.32
7.3.160.0130.00516.42
7.3.150.0200.00416.24
7.3.140.0150.00816.25
7.3.130.0200.00316.30
7.3.120.0120.00515.48
7.3.110.0070.01416.00
7.3.100.0140.00316.26
7.3.90.0070.01516.28
7.3.80.0150.00516.63
7.3.70.0030.01316.31
7.3.60.0090.00916.14
7.3.50.0150.00316.34
7.3.40.0120.00416.43
7.3.30.0130.00316.37
7.3.20.0140.00318.11
7.3.10.0060.00918.06
7.3.00.0100.00718.05
7.2.330.0040.01316.68
7.2.320.0090.01216.47
7.2.310.0060.01716.68
7.2.300.0070.00916.38
7.2.290.0100.00716.44
7.2.280.0070.01316.60
7.2.270.0070.01116.40
7.2.260.0100.01016.47
7.2.250.0120.00616.30
7.2.240.0080.01016.29
7.2.230.0030.01316.41
7.2.220.0090.01216.70
7.2.210.0140.01216.34
7.2.200.0090.00916.70
7.2.190.0090.01216.59
7.2.180.0140.00616.57
7.2.170.0080.00816.60
7.2.160.0140.00816.33
7.2.150.0130.00718.17
7.2.140.0080.01218.24
7.2.130.0070.01318.38
7.2.120.0130.00618.30
7.2.110.0110.00618.41
7.2.100.0140.00518.04
7.2.90.0110.01118.58
7.2.80.0060.01318.19
7.2.70.0110.00818.25
7.2.60.0150.00918.06
7.2.50.0070.02118.21
7.2.40.0070.02018.41
7.2.30.0130.01018.22
7.2.20.0130.00718.22
7.2.10.0200.00818.40
7.2.00.0090.01118.75
7.1.330.0180.01417.38
7.1.320.0060.01217.22
7.1.310.0270.00417.42
7.1.300.0220.01117.23
7.1.290.0170.01217.35
7.1.280.0170.01117.32
7.1.270.0240.00817.35
7.1.260.0210.00717.27
7.1.250.0290.00017.49
7.1.240.0200.00617.17
7.1.230.0210.00917.32
7.1.220.0160.01317.29
7.1.210.0150.01517.43
7.1.200.0210.00917.36
7.1.190.0260.00717.32
7.1.180.0270.01217.25
7.1.170.0250.00717.21
7.1.160.0200.01617.39
7.1.150.0260.00517.11
7.1.140.0260.00417.23
7.1.130.0220.01117.14
7.1.120.0180.01417.39
7.1.110.0290.00717.37
7.1.100.0140.01217.67
7.1.90.0310.00617.32
7.1.80.0240.01017.32
7.1.70.0110.01117.13
7.1.60.0100.01217.05
7.1.50.0190.00916.99
7.1.40.0230.01217.35
7.1.30.0230.01017.27
7.1.20.0270.00717.40
7.1.10.0280.00317.38
7.1.00.0120.03019.79
7.0.330.0270.00416.98
7.0.320.0240.00317.10
7.0.310.0200.01117.01
7.0.300.0230.01316.90
7.0.290.0250.00817.17
7.0.280.0190.01116.92
7.0.270.0170.01317.03
7.0.260.0240.00816.86
7.0.250.0270.00917.03
7.0.240.0160.01617.13
7.0.230.0230.01316.99
7.0.220.0180.01417.02
7.0.210.0240.00716.95
7.0.200.0190.00416.96
7.0.190.0260.00717.07
7.0.180.0210.00816.90
7.0.170.0200.01016.96
7.0.160.0200.00817.04
7.0.150.0290.00417.00
7.0.140.0130.03819.46
7.0.130.0170.01017.16
7.0.120.0130.01717.07
7.0.110.0250.00417.05
7.0.100.0250.00917.07
7.0.90.0100.02016.86
7.0.80.0240.00617.15
7.0.70.0110.03819.38
7.0.60.0130.04319.47
7.0.50.0100.04619.45
7.0.40.0100.04218.56
7.0.30.0160.02818.55
7.0.20.0180.03818.51
7.0.10.0120.04518.46
7.0.00.0130.04718.58
5.6.400.0210.00715.89
5.6.390.0190.01315.80
5.6.380.0140.02115.82
5.6.370.0160.01315.96
5.6.360.0180.02216.10
5.6.350.0190.01315.64
5.6.340.0240.01215.91
5.6.330.0160.01615.99
5.6.320.0210.01516.02
5.6.310.0170.01715.95
5.6.300.0150.01516.09
5.6.290.0250.01315.80
5.6.280.0120.04118.31
5.6.270.0150.01515.93
5.6.260.0210.01415.81
5.6.250.0270.00315.90
5.6.240.0170.01015.92
5.6.230.0160.01215.75
5.6.220.0120.02418.28
5.6.210.0120.04718.15
5.6.200.0140.04218.38
5.6.190.0150.04618.31
5.6.180.0110.04718.36
5.6.170.0180.03918.38
5.6.160.0130.04718.47
5.6.150.0170.04518.42
5.6.140.0170.03718.48
5.6.130.0150.04218.47
5.6.120.0100.04518.41
5.6.110.0140.03018.43
5.6.100.0100.04918.47
5.6.90.0150.04518.41
5.6.80.0120.04617.98
5.6.70.0080.03018.00
5.6.60.0100.03018.06
5.6.50.0160.03618.12
5.6.40.0160.03218.00
5.6.30.0130.04218.05
5.6.20.0090.04217.98
5.6.10.0070.05018.09
5.6.00.0110.02818.07
5.5.380.0140.01415.54
5.5.370.0210.01115.82
5.5.360.0090.05018.01
5.5.350.0180.04518.04
5.5.340.0160.04218.25
5.5.330.0090.04218.28
5.5.320.0090.04818.36
5.5.310.0160.03918.33
5.5.300.0110.04518.26
5.5.290.0140.04518.34
5.5.280.0100.04118.16
5.5.270.0130.03018.40
5.5.260.0120.04818.26
5.5.250.0160.03518.18
5.5.240.0060.03817.88
5.5.230.0100.02617.93
5.5.220.0130.02917.94
5.5.210.0190.03717.96
5.5.200.0130.03618.00
5.5.190.0110.04917.86
5.5.180.0100.04218.10
5.5.170.0290.00015.68
5.5.160.0090.04417.95
5.5.150.0130.04517.87
5.5.140.0140.02617.89
5.5.130.0140.03317.95
5.5.120.0140.04417.81
5.5.110.0100.04517.98
5.5.100.0090.03818.00
5.5.90.0140.03618.03
5.5.80.0160.02617.87
5.5.70.0150.03117.83
5.5.60.0110.04117.91
5.5.50.0110.04117.90
5.5.40.0140.04217.86
5.5.30.0060.03517.82
5.5.20.0120.04417.79
5.5.10.0170.03717.89
5.5.00.0070.03317.80
5.4.450.0120.03715.84
5.4.440.0190.02815.95
5.4.430.0090.04315.91
5.4.420.0130.04215.93
5.4.410.0120.04015.89
5.4.400.0090.03115.81
5.4.390.0090.04215.80
5.4.380.0100.03915.63
5.4.370.0080.04015.80
5.4.360.0100.03015.61
5.4.350.0100.04115.79
5.4.340.0090.03615.79
5.4.330.0170.00412.45
5.4.320.0100.03115.84
5.4.310.0090.02515.72
5.4.300.0070.03515.86
5.4.290.0100.02915.73
5.4.280.0060.04715.72
5.4.270.0090.04115.62
5.4.260.0150.02715.76
5.4.250.0130.03715.62
5.4.240.0110.03515.92
5.4.230.0090.04315.65
5.4.220.0070.03115.79
5.4.210.0080.04515.76
5.4.200.0110.04115.79
5.4.190.0090.04115.74
5.4.180.0070.04715.81
5.4.170.0100.02215.80
5.4.160.0110.02115.56
5.4.150.0070.02515.68
5.4.140.0050.02514.44
5.4.130.0080.02114.44
5.4.120.0070.02114.47
5.4.110.0060.02314.43
5.4.100.0070.02414.48
5.4.90.0060.02314.42
5.4.80.0040.02414.38
5.4.70.0070.02114.40
5.4.60.0050.02314.40
5.4.50.0090.02314.47
5.4.40.0070.02614.42
5.4.30.0090.03314.34
5.4.20.0110.03314.42
5.4.10.0090.02114.46
5.4.00.0080.02414.21
5.3.290.0050.04713.90
5.3.280.0090.02713.81
5.3.270.0140.04213.85
5.3.260.0050.02713.87
5.3.250.0070.02313.78
5.3.240.0090.02213.75
5.3.230.0110.01813.79
5.3.220.0070.04113.62
5.3.210.0110.02413.64
5.3.200.0080.02113.77
5.3.190.0090.02213.75
5.3.180.0070.02213.80
5.3.170.0090.01813.74
5.3.160.0110.02213.69
5.3.150.0110.01813.69
5.3.140.0070.02013.70
5.3.130.0040.02813.68
5.3.120.0050.02613.71
5.3.110.0090.02313.73
5.3.100.0070.02213.47
5.3.90.0050.02413.35
5.3.80.0040.03413.30
5.3.70.0070.02313.37
5.3.60.0100.02113.47
5.3.50.0100.01813.44
5.3.40.0040.03113.37
5.3.30.0080.02613.37
5.3.20.0080.02313.19
5.3.10.0060.02113.18
5.3.00.0050.03213.15
5.2.170.0050.02012.24
5.2.160.0050.02312.31
5.2.150.0080.01912.17
5.2.140.0040.02012.20
5.2.130.0060.02012.25
5.2.120.0050.01612.19
5.2.110.0070.01512.23
5.2.100.0070.02612.29
5.2.90.0070.01712.18
5.2.80.0070.02012.13
5.2.70.0070.01912.18
5.2.60.0090.03012.07
5.2.50.0070.01312.07
5.2.40.0090.03112.16
5.2.30.0080.01512.09
5.2.20.0030.02212.09
5.2.10.0060.01712.17
5.2.00.0050.01412.16
5.1.60.0090.01412.06
5.1.50.0040.01512.06
5.1.40.0030.01412.06
5.1.30.0030.01812.06
5.1.20.0060.01512.06
5.1.10.0080.01312.06
5.1.00.0030.01812.06
5.0.50.0050.01312.06
5.0.40.0030.01312.06
5.0.30.0030.01812.06
5.0.20.0040.02212.06
5.0.10.0000.02612.06
5.0.00.0070.01712.06
4.4.90.0060.00712.06
4.4.80.0090.00512.06
4.4.70.0030.01112.06
4.4.60.0000.01012.06
4.4.50.0060.00812.06
4.4.40.0050.01212.06
4.4.30.0020.01112.06
4.4.20.0050.00812.06
4.4.10.0030.00812.06
4.4.00.0040.01812.06
4.3.110.0030.00812.06
4.3.100.0020.01212.06
4.3.90.0040.01212.06
4.3.80.0040.01512.06
4.3.70.0040.00712.06
4.3.60.0040.00812.06
4.3.50.0030.01612.06
4.3.40.0020.01512.06
4.3.30.0020.01312.06
4.3.20.0020.01412.06
4.3.10.0020.01812.06
4.3.00.0030.02012.06

preferences:
61.94 ms | 401 KiB | 5 Q