3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = "\xC2°Freen\x18 ew°\x90ɮ\x7F\xA0\xC2 \xc2blabla"; //$result="a\xC2"; echo PHP_VERSION; 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.40.0130.00718.70
8.3.30.0100.00318.71
8.3.20.0080.00018.77
8.3.10.0040.00418.90
8.3.00.0080.00019.38
8.2.170.0140.00722.96
8.2.160.0100.01018.95
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00420.70
8.2.110.0040.00721.05
8.2.100.0120.00017.84
8.2.90.0060.00317.91
8.2.80.0030.00617.97
8.2.70.0070.00317.68
8.2.60.0040.00418.22
8.2.50.0040.00418.10
8.2.40.0000.00719.34
8.2.30.0030.00519.23
8.2.20.0020.00717.78
8.2.10.0000.00917.79
8.2.00.0000.00717.80
8.1.270.0000.00723.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00622.24
8.1.230.0070.00422.67
8.1.220.0060.00317.77
8.1.210.0060.00320.06
8.1.200.0060.00317.25
8.1.190.0000.00817.22
8.1.180.0040.00418.10
8.1.170.0000.00818.49
8.1.160.0000.00719.05
8.1.150.0040.00418.60
8.1.140.0050.00217.56
8.1.130.0000.00717.91
8.1.120.0000.00717.45
8.1.110.0000.00817.56
8.1.100.0000.00717.46
8.1.90.0050.00317.49
8.1.80.0080.00017.46
8.1.70.0000.00817.48
8.1.60.0000.00717.61
8.1.50.0000.00717.42
8.1.40.0040.00417.69
8.1.30.0040.00417.77
8.1.20.0030.00617.64
8.1.10.0000.00817.56
8.1.00.0000.00917.57
8.0.300.0080.00021.95
8.0.290.0040.00416.88
8.0.280.0060.00318.46
8.0.270.0030.00517.41
8.0.260.0030.00316.98
8.0.250.0040.00417.13
8.0.240.0030.00517.00
8.0.230.0070.00016.94
8.0.220.0000.00716.88
8.0.210.0070.00017.01
8.0.200.0060.00017.00
8.0.190.0080.00016.96
8.0.180.0080.00016.95
8.0.170.0080.00016.84
8.0.160.0000.00717.02
8.0.150.0080.00016.92
8.0.140.0110.00216.83
8.0.130.0060.00013.50
8.0.120.0000.01016.97
8.0.110.0050.00316.81
8.0.100.0000.00716.89
8.0.90.0000.00717.12
8.0.80.0080.01116.99
8.0.70.0000.00717.02
8.0.60.0050.00216.94
8.0.50.0070.00016.86
8.0.30.0060.01217.00
8.0.20.0140.02617.02
8.0.10.0040.00417.04
8.0.00.0060.01116.96
7.4.330.0000.00613.02
7.4.320.0000.00616.52
7.4.300.0070.00016.61
7.4.290.0000.00716.64
7.4.280.0040.00416.53
7.4.270.0030.00316.50
7.4.260.0030.00313.34
7.4.250.0060.00316.43
7.4.240.0000.00716.64
7.4.230.0000.00716.71
7.4.220.0060.00916.64
7.4.210.0140.00716.51
7.4.200.0040.00416.58
7.4.190.0000.00716.61
7.4.160.0060.00916.60
7.4.150.0070.01116.47
7.4.140.0060.01216.35
7.4.130.0030.01316.47
7.4.120.0120.00616.64
7.4.110.0180.00616.46
7.4.100.0000.01716.41
7.4.90.0120.00616.39
7.4.80.0070.01019.39
7.4.70.0160.00516.35
7.4.60.0160.01516.40
7.4.50.0090.00716.26
7.4.40.0130.00516.47
7.4.30.0090.00916.46
7.4.20.0050.01216.49
7.4.10.0150.00416.30
7.4.00.0070.00815.56
7.3.330.0030.00313.09
7.3.320.0000.00613.11
7.3.310.0000.00716.29
7.3.300.0030.00316.27
7.3.290.0110.00516.23
7.3.280.0070.01116.28
7.3.270.0090.00916.35
7.3.260.0070.01116.54
7.3.250.0100.00916.32
7.3.240.0170.00016.48
7.3.230.0070.01616.19
7.3.210.0070.01016.30
7.3.200.0180.00016.38
7.3.190.0070.01516.31
7.3.180.0060.01216.13
7.3.170.0070.01216.45
7.3.160.0040.01216.29
7.3.150.0070.01016.26
7.3.140.0100.00616.25
7.3.130.0130.00616.22
7.3.120.0050.01115.50
7.3.110.0100.01416.46
7.3.100.0110.00716.42
7.3.90.0140.00316.21
7.3.80.0130.01016.28
7.3.70.0040.01316.25
7.3.60.0100.01016.17
7.3.50.0160.00316.05
7.3.40.0050.01416.06
7.3.30.0080.00816.20
7.3.20.0170.00016.14
7.3.10.0070.01016.18
7.3.00.0050.01316.34
7.2.330.0160.00916.45
7.2.320.0100.00716.48
7.2.310.0120.00716.49
7.2.300.0080.01216.46
7.2.290.0110.00816.51
7.2.280.0070.01016.49
7.2.270.0120.00616.54
7.2.260.0060.01116.25
7.2.250.0120.01216.62
7.2.240.0130.00616.27
7.2.230.0110.00816.33
7.2.220.0100.00616.36
7.2.210.0090.00916.39
7.2.200.0100.01016.24
7.2.190.0120.00916.28
7.2.180.0040.01716.61
7.2.170.0150.00516.50
7.2.160.0110.00716.68
7.2.150.0110.00716.51
7.2.140.0090.01316.40
7.2.130.0030.01416.50
7.2.120.0100.01416.17
7.2.110.0060.01116.41
7.2.100.0130.00616.48
7.2.90.0130.00916.42
7.2.80.0120.00916.45
7.2.70.0080.01216.48
7.2.60.0170.00316.79
7.2.50.0180.00616.41
7.2.40.0080.01116.61
7.2.30.0110.00516.46
7.2.20.0390.00916.46
7.2.10.0120.00916.48
7.2.00.0080.00917.59
7.1.330.0270.00515.72
7.1.320.0200.01115.57
7.1.310.0240.00815.63
7.1.300.0230.00615.78
7.1.290.0220.00915.65
7.1.280.0200.01015.60
7.1.270.0200.00715.68
7.1.260.0200.01015.29
7.1.250.0220.00915.49
7.1.240.0210.00815.53
7.1.230.0230.00315.39
7.1.220.0120.01615.51
7.1.210.0230.00815.52
7.1.200.0140.00615.68
7.1.190.0180.01015.69
7.1.180.0230.00615.56
7.1.170.0180.01215.52
7.1.160.0280.00715.43
7.1.150.0440.00915.71
7.1.140.0210.00715.62
7.1.130.0230.00615.45
7.1.120.0220.00715.48
7.1.110.0240.00515.42
7.1.100.0190.00216.72
7.1.90.0240.00315.49
7.1.80.0200.01015.47
7.1.70.0030.01616.40
7.1.60.0570.01017.35
7.1.50.0140.01316.13
7.1.40.0110.01715.57
7.1.30.0220.01115.62
7.1.20.0230.01015.66
7.1.10.0270.00615.48
7.1.00.0170.03918.97
7.0.330.0280.00015.43
7.0.320.0240.00315.20
7.0.310.0230.00914.99
7.0.300.0190.00515.25
7.0.290.0320.01215.36
7.0.280.0150.01215.17
7.0.270.0210.00515.11
7.0.260.0180.01115.11
7.0.250.0130.01915.32
7.0.240.0260.00015.32
7.0.230.0190.01215.19
7.0.220.0200.00915.21
7.0.210.0190.00715.18
7.0.200.0160.00415.98
7.0.190.0190.01315.23
7.0.180.0220.01015.30
7.0.170.0210.01315.26
7.0.160.0190.01015.26
7.0.150.0290.00615.11
7.0.140.0160.03618.62
7.0.130.0280.00615.30
7.0.120.0110.04218.64
7.0.110.0220.01115.32
7.0.100.0230.01015.27
7.0.90.0270.00715.05
7.0.80.0190.01315.29
7.0.70.0300.00715.23
7.0.60.0130.04518.45
7.0.50.0150.04116.63
7.0.40.0220.03917.85
7.0.30.0290.02017.69
7.0.20.0340.03717.62
7.0.10.0150.04317.71
7.0.00.0160.03417.69
5.6.400.0230.01715.77
5.6.390.0250.00515.98
5.6.380.0150.01515.80
5.6.370.0120.01616.02
5.6.360.0210.01115.90
5.6.350.0200.01315.79
5.6.340.0260.01115.74
5.6.330.0160.01215.89
5.6.320.0200.01315.59
5.6.310.0150.01515.91
5.6.300.0300.00316.06
5.6.290.0260.00715.79
5.6.280.0090.04518.40
5.6.270.0230.01516.12
5.6.260.0210.01315.87
5.6.250.0230.00815.98
5.6.240.0300.00315.91
5.6.230.0200.01015.80
5.6.220.0170.01715.90
5.6.210.0130.03618.27
5.6.200.0130.03517.08
5.6.190.0080.03218.18
5.6.180.0260.04518.12
5.6.170.0250.04318.21
5.6.160.0170.02818.10
5.6.150.0100.03317.02
5.6.140.0110.04617.00
5.6.130.0190.04417.03
5.6.120.0130.03818.41
5.6.110.0100.03018.57
5.6.100.0150.04618.48
5.6.90.0150.02318.60
5.6.80.0100.04418.09
5.6.70.0250.01115.59
5.6.60.0200.00915.60
5.6.50.0180.01115.76
5.6.40.0220.00815.62
5.6.30.0220.01415.61
5.6.20.0200.00915.57
5.6.10.0170.01115.73
5.6.00.0200.01315.73
5.5.380.0110.01915.62
5.5.370.0270.01015.77
5.5.360.0170.02015.81
5.5.350.0120.04418.14
5.5.340.0180.01816.71
5.5.330.0160.04917.89
5.5.320.0220.02818.17
5.5.310.0330.03317.93
5.5.300.0160.02216.91
5.5.290.0140.04916.83
5.5.280.0190.04218.33
5.5.270.0170.04218.36
5.5.260.0110.05118.15
5.5.250.0160.04218.36
5.5.240.0140.04917.83
5.5.230.0230.00615.74
5.5.220.0140.01415.66
5.5.210.0240.00615.60
5.5.200.0280.01015.66
5.5.190.0200.01415.77
5.5.180.0180.00915.64
5.5.170.0220.00615.71
5.5.160.0140.01415.80
5.5.150.0180.01515.93
5.5.140.0260.00915.89
5.5.130.0100.01515.58
5.5.120.0150.01515.50
5.5.110.0250.00715.70
5.5.100.0230.01015.89
5.5.90.0170.01215.73
5.5.80.0200.00815.83
5.5.70.0280.00815.78
5.5.60.0160.01615.64
5.5.50.0250.00915.71
5.5.40.0090.02315.87
5.5.30.0200.00915.87
5.5.20.0190.01315.68
5.5.10.0140.01515.82
5.5.00.0220.00615.61
5.4.450.2040.02316.06
5.4.440.2090.02516.05
5.4.430.2320.02116.12
5.4.420.2130.02515.87
5.4.410.1950.02615.96
5.4.400.2130.02115.80
5.4.390.2150.02215.73
5.4.380.2130.02115.87
5.4.370.2140.02115.77
5.4.360.2090.02215.76
5.4.350.1970.02515.68
5.4.340.2240.02415.81
5.4.330.0120.00912.54
5.4.320.0540.03915.84
5.4.310.1980.02715.84
5.4.300.2340.02115.82
5.4.290.2300.02715.69
5.4.280.2090.02515.77
5.4.270.2160.02315.81
5.4.260.1930.01915.93
5.4.250.2110.02515.87
5.4.240.2270.02115.74
5.4.230.2090.02415.74
5.4.220.0160.03015.77
5.4.210.1610.02515.63
5.4.200.2010.02215.74
5.4.190.2060.02415.77
5.4.180.2090.02215.70
5.4.170.2400.02215.76
5.4.160.2380.02415.68
5.4.150.2460.02415.77
5.4.140.1820.02514.34
5.4.130.1920.01814.60
5.4.120.2030.02114.43
5.4.110.2310.02614.34
5.4.100.2270.02314.54
5.4.90.2410.02114.41
5.4.80.1600.01814.53
5.4.70.1620.02114.52
5.4.60.1530.02414.55
5.4.50.1790.02414.56
5.4.40.1770.02014.42
5.4.30.1930.01714.49
5.4.20.1750.02014.52
5.4.10.1670.02314.38
5.4.00.1700.02314.08
5.3.290.1960.02113.76
5.3.280.0130.02413.79
5.3.270.2390.02013.72
5.3.260.2460.02413.81
5.3.250.2080.02313.79
5.3.240.1930.02613.78
5.3.230.1940.02413.78
5.3.220.2250.02213.72
5.3.210.2320.02513.63
5.3.200.2210.02613.65
5.3.190.2400.02113.67
5.3.180.1800.02913.75
5.3.170.1640.02213.86
5.3.160.1320.02413.75
5.3.150.1550.02013.79
5.3.140.1760.02213.67
5.3.130.1800.02513.72
5.3.120.1570.02413.75
5.3.110.1830.02313.69
5.3.100.1860.02113.52
5.3.90.1930.02113.49
5.3.80.2020.02213.33
5.3.70.1880.02213.43
5.3.60.1830.02313.48
5.3.50.1930.02313.42
5.3.40.2080.02413.38
5.3.30.2020.02213.30
5.3.20.1920.02813.31
5.3.10.2000.02013.16
5.3.00.1940.02413.18
5.2.170.1650.01411.67
5.2.160.1650.01611.73
5.2.150.1700.02411.69
5.2.140.1570.02111.61
5.2.130.1680.02311.69
5.2.120.1600.01711.66
5.2.110.1500.01811.65
5.2.100.1770.02011.70
5.2.90.1820.02211.65
5.2.80.1690.01611.65
5.2.70.1950.01711.50
5.2.60.1930.01511.47
5.2.50.1820.01511.46
5.2.40.1550.02411.51
5.2.30.1580.02211.47
5.2.20.1540.01711.42
5.2.10.1470.01611.33
5.2.00.1450.01611.34
5.1.60.1460.01510.94
5.1.50.1530.01410.95
5.1.40.1470.01510.94
5.1.30.1550.01711.20
5.1.20.1310.01511.11
5.1.10.1630.01911.00
5.1.00.1610.01411.00
5.0.50.0860.00910.22
5.0.40.0820.01310.08
5.0.30.0630.02010.06
5.0.20.0780.01510.07
5.0.10.0750.01210.03
5.0.00.0750.01810.11
4.4.90.0920.0078.93
4.4.80.0930.0088.93
4.4.70.0730.0108.93
4.4.60.0900.0078.93
4.4.50.0880.0148.93
4.4.40.0830.0178.93
4.4.30.0870.0138.93
4.4.20.0830.0108.93
4.4.10.0720.0118.93
4.4.00.0700.0178.93
4.3.110.0610.0088.93
4.3.100.0600.0098.93
4.3.90.0780.0058.93
4.3.80.0870.0138.93
4.3.70.0780.0108.93
4.3.60.0780.0088.93
4.3.50.0860.0088.93
4.3.40.0600.0178.93
4.3.30.0390.0108.93
4.3.20.0500.0128.93
4.3.10.0460.0108.93
4.3.00.0400.0098.93

preferences:
37.46 ms | 400 KiB | 5 Q