3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = "\xC2°Freen\x18 ew°\x90ɮ\x7F\xA0\xC2 \xc2blabla"; //$result="a\xC2"; $result = preg_replace('~[\x{0000}-\x{000F}\x{007F}-\x{00a0}]~S', '', $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.60.0110.00316.75
8.3.50.0080.01117.60
8.3.40.0090.00618.96
8.3.30.0110.00418.84
8.3.20.0000.00818.85
8.3.10.0060.00320.72
8.3.00.0050.00319.63
8.2.180.0040.01816.88
8.2.170.0120.00622.96
8.2.160.0120.00320.93
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0000.00726.16
8.2.120.0040.00421.11
8.2.110.0040.00421.15
8.2.100.0080.00417.97
8.2.90.0030.00619.34
8.2.80.0070.00019.40
8.2.70.0040.00417.88
8.2.60.0030.00517.80
8.2.50.0060.00318.07
8.2.40.0070.00018.03
8.2.30.0000.00718.16
8.2.20.0040.00817.87
8.2.10.0080.00017.98
8.2.00.0040.00717.99
8.1.280.0090.00625.92
8.1.270.0040.00423.99
8.1.260.0060.00326.35
8.1.250.0030.00528.09
8.1.240.0030.00622.53
8.1.230.0030.00920.86
8.1.220.0060.00317.76
8.1.210.0000.00818.92
8.1.200.0090.00017.48
8.1.190.0040.00417.53
8.1.180.0040.00418.10
8.1.170.0060.00318.84
8.1.160.0000.00919.00
8.1.150.0040.00418.82
8.1.140.0040.00417.70
8.1.130.0000.00717.91
8.1.120.0000.00917.63
8.1.110.0040.00417.61
8.1.100.0060.00317.48
8.1.90.0030.00517.67
8.1.80.0000.00717.55
8.1.70.0040.00417.51
8.1.60.0030.00917.74
8.1.50.0030.00617.59
8.1.40.0090.00017.60
8.1.30.0000.00817.70
8.1.20.0000.00817.72
8.1.10.0050.00317.67
8.1.00.0030.00517.64
8.0.300.0040.00420.03
8.0.290.0080.00016.88
8.0.280.0030.00318.48
8.0.270.0030.00317.36
8.0.260.0000.00816.93
8.0.250.0070.00017.12
8.0.240.0040.00417.12
8.0.230.0000.00717.20
8.0.220.0030.00517.14
8.0.210.0030.00317.04
8.0.200.0000.00717.06
8.0.190.0000.00817.18
8.0.180.0040.00417.14
8.0.170.0060.00317.07
8.0.160.0060.00317.05
8.0.150.0000.01117.10
8.0.140.0030.00517.13
8.0.130.0000.00513.48
8.0.120.0000.00917.19
8.0.110.0060.00317.25
8.0.100.0000.00917.13
8.0.90.0040.00417.24
8.0.80.0130.01017.30
8.0.70.0030.00617.13
8.0.60.0040.00417.30
8.0.50.0000.00917.32
8.0.30.0060.01217.63
8.0.20.0100.01517.35
8.0.10.0000.00917.25
8.0.00.0080.01717.11
7.4.330.0000.00613.14
7.4.320.0060.00016.86
7.4.300.0030.00316.74
7.4.290.0040.00416.75
7.4.280.0030.00716.84
7.4.270.0040.00416.73
7.4.260.0030.00313.52
7.4.250.0050.00516.99
7.4.240.0040.00417.01
7.4.230.0030.00516.86
7.4.220.0160.00616.94
7.4.210.0060.01016.90
7.4.200.0060.00316.94
7.4.190.0030.00517.11
7.4.160.0120.01217.02
7.4.150.0070.01317.01
7.4.140.0100.01416.89
7.4.130.0140.00916.77
7.4.120.0040.01316.93
7.4.110.0130.00716.83
7.4.100.0130.00716.81
7.4.90.0210.00616.89
7.4.80.0130.01319.39
7.4.70.0130.01216.63
7.4.60.0130.01516.62
7.4.50.0080.01016.71
7.4.40.0120.00816.48
7.4.30.0110.01416.51
7.4.20.0000.02316.39
7.4.10.0110.01116.52
7.4.00.0130.00916.04
7.3.330.0030.00313.27
7.3.320.0000.00613.11
7.3.310.0040.00416.54
7.3.300.0000.00816.49
7.3.290.0070.01416.52
7.3.280.0100.01016.50
7.3.270.0060.01516.76
7.3.260.0160.01016.52
7.3.250.0120.00916.64
7.3.240.0140.01016.54
7.3.230.0060.01216.86
7.3.210.0070.01116.55
7.3.200.0060.01316.46
7.3.190.0150.01216.71
7.3.180.0080.01316.59
7.3.170.0080.01416.43
7.3.160.0110.01116.56
7.3.150.0120.01216.44
7.3.140.0100.01316.59
7.3.130.0030.01816.67
7.3.120.0130.00815.86
7.3.110.0040.01716.32
7.3.100.0110.01116.54
7.3.90.0090.01216.70
7.3.80.0110.01716.50
7.3.70.0140.01116.34
7.3.60.0080.01216.39
7.3.50.0150.00616.47
7.3.40.0030.01616.50
7.3.30.0090.01116.56
7.3.20.0130.01316.29
7.3.10.0270.01816.56
7.3.00.0100.01116.78
7.2.330.0100.01016.82
7.2.320.0100.00916.95
7.2.310.0090.01616.73
7.2.300.0120.01116.78
7.2.290.0110.01416.95
7.2.280.0090.00916.67
7.2.270.0070.01716.82
7.2.260.0110.01116.74
7.2.250.0220.00416.79
7.2.240.0170.00616.59
7.2.230.0090.01516.67
7.2.220.0140.01416.71
7.2.210.0090.01216.77
7.2.200.0050.01616.70
7.2.190.0000.02316.82
7.2.180.0160.01016.68
7.2.170.0120.01516.79
7.2.160.0090.00916.67
7.2.150.0180.00516.79
7.2.140.0140.01516.78
7.2.130.0030.01716.82
7.2.120.0060.01116.90
7.2.110.0120.00816.94
7.2.100.0060.01016.99
7.2.90.0110.00616.95
7.2.80.0130.01016.98
7.2.70.0060.01116.97
7.2.60.0070.01316.98
7.2.50.0130.00616.95
7.2.40.0110.01317.01
7.2.30.0080.01017.00
7.2.20.0170.00716.94
7.2.10.0080.01216.97
7.2.00.0100.01217.10
7.1.330.0350.01015.80
7.1.320.0380.00415.95
7.1.310.0170.01715.70
7.1.300.0300.00515.66
7.1.290.0180.01515.75
7.1.280.0190.01515.86
7.1.270.0150.01715.81
7.1.260.0280.01215.69
7.1.250.0170.00715.89
7.1.240.0150.01215.76
7.1.230.0100.01215.78
7.1.220.0130.01215.68
7.1.210.0150.01415.84
7.1.200.0120.01115.88
7.1.190.0150.00715.98
7.1.180.0210.01115.76
7.1.170.0150.00915.77
7.1.160.0140.01215.76
7.1.150.0120.01015.89
7.1.140.0130.01215.81
7.1.130.0160.00515.78
7.1.120.0130.01015.82
7.1.110.0110.01215.80
7.1.100.0240.00815.70
7.1.90.0120.01515.98
7.1.80.0170.00915.69
7.1.70.0090.01016.47
7.1.60.0120.00916.92
7.1.50.0120.01216.35
7.1.40.0130.01015.77
7.1.30.0170.00915.83
7.1.20.0150.00915.84
7.1.10.0120.01115.92
7.1.00.0100.03317.99
7.0.330.0190.00815.33
7.0.320.0130.01115.62
7.0.310.0140.01115.48
7.0.300.0160.00815.60
7.0.290.0150.01315.66
7.0.280.0180.01215.49
7.0.270.0130.00915.53
7.0.260.0100.01415.51
7.0.250.0130.01415.54
7.0.240.0140.01115.49
7.0.230.0140.01015.41
7.0.220.0130.01315.43
7.0.210.0120.01215.43
7.0.200.0100.01015.95
7.0.190.0130.01115.49
7.0.180.0160.00815.49
7.0.170.0140.01315.45
7.0.160.0140.01215.37
7.0.150.0190.00615.53
7.0.140.0190.02917.54
7.0.130.0150.01215.60
7.0.120.0070.03317.75
7.0.110.0120.01215.52
7.0.100.0200.00715.47
7.0.90.0190.00715.49
7.0.80.0090.01415.42
7.0.70.0080.01515.52
7.0.60.0080.03216.98
7.0.50.0130.03116.43
7.0.40.0150.03216.54
7.0.30.0080.03516.57
7.0.20.0290.02016.42
7.0.10.0120.02216.44
7.0.00.0120.02116.48
5.6.400.0250.01716.15
5.6.390.0190.01216.26
5.6.380.0170.00615.20
5.6.370.0120.01015.28
5.6.360.0150.01115.40
5.6.350.0150.01215.44
5.6.340.0100.01415.25
5.6.330.0120.01815.29
5.6.320.0130.01315.10
5.6.310.0190.00715.05
5.6.300.0170.00715.26
5.6.290.0090.01515.46
5.6.280.0090.03217.16
5.6.270.0150.00615.22
5.6.260.0110.01215.35
5.6.250.0130.01215.08
5.6.240.0200.00715.16
5.6.230.0080.01715.08
5.6.220.0110.01715.32
5.6.210.0120.02316.91
5.6.200.0100.02016.23
5.6.190.0160.02017.02
5.6.180.0230.03117.04
5.6.170.0230.03016.93
5.6.160.0170.01916.90
5.6.150.0100.03516.29
5.6.140.0070.03816.21
5.6.130.0130.02016.33
5.6.120.0140.03617.15
5.6.110.0080.03617.26
5.6.100.0110.03517.19
5.6.90.0120.02317.12
5.6.80.0100.03317.00
5.6.70.0140.01215.25
5.6.60.0080.01815.18
5.6.50.0140.01215.16
5.6.40.0120.00915.09
5.6.30.0100.01314.90
5.6.20.0100.01515.07
5.6.10.0150.01114.97
5.6.00.0130.01215.12
5.5.380.0110.00813.41
5.5.370.0110.01113.41
5.5.360.0180.00913.44
5.5.350.1550.01715.61
5.5.340.0110.03115.02
5.5.330.0140.02015.99
5.5.320.0230.01615.79
5.5.310.0210.02315.86
5.5.300.0150.02114.95
5.5.290.0160.03315.19
5.5.280.0120.03416.07
5.5.270.0140.02016.14
5.5.260.0130.02616.02
5.5.250.0190.03615.76
5.5.240.0160.02615.72
5.5.230.0100.01313.59
5.5.220.0160.00813.47
5.5.210.0160.00813.40
5.5.200.0120.01013.35
5.5.190.0100.01113.35
5.5.180.0160.00513.32
5.5.170.0170.01113.26
5.5.160.0160.01313.34
5.5.150.0160.00613.45
5.5.140.0080.01113.34
5.5.130.0150.00913.46
5.5.120.0080.01213.32
5.5.110.0160.00713.49
5.5.100.0130.00713.26
5.5.90.0110.00913.46
5.5.80.0100.01313.34
5.5.70.0100.01313.42
5.5.60.0140.01113.37
5.5.50.0240.00413.36
5.5.40.0100.01313.44
5.5.30.0150.01013.59
5.5.20.0170.00413.37
5.5.10.0160.00513.29
5.5.00.0160.00513.40
5.4.450.0210.01914.41
5.4.440.0130.02114.46
5.4.430.0150.03014.37
5.4.420.0220.02814.29
5.4.410.0190.02514.34
5.4.400.0150.01914.34
5.4.390.0160.01414.14
5.4.380.0220.02914.27
5.4.370.0200.01714.16
5.4.360.0160.03014.15
5.4.350.0190.01814.16
5.4.340.0150.01814.09
5.4.330.0170.00311.73
5.4.320.0160.02814.14
5.4.310.0210.02113.99
5.4.300.0140.02214.06
5.4.290.0160.02614.19
5.4.280.0150.01914.08
5.4.270.0120.01614.21
5.4.260.0130.01714.24
5.4.250.0140.02814.17
5.4.240.0160.02714.16
5.4.230.0160.02113.99
5.4.220.0210.02514.16
5.4.210.0150.02714.19
5.4.200.0120.02114.06
5.4.190.0140.01714.12
5.4.180.0140.01913.98
5.4.170.0180.03014.17
5.4.160.0070.02614.01
5.4.150.0170.02714.02
5.4.140.0150.02313.13
5.4.130.0140.02513.28
5.4.120.0120.02913.27
5.4.110.0100.02313.14
5.4.100.0150.02713.34
5.4.90.0110.02313.31
5.4.80.0100.02113.11
5.4.70.0070.03613.46
5.4.60.0160.01413.36
5.4.50.0170.02113.24
5.4.40.0130.02513.36
5.4.30.0160.02013.35
5.4.20.0120.01613.41
5.4.10.0200.01513.35
5.4.00.0120.01813.08
5.3.290.0160.02412.89
5.3.280.0120.02512.71
5.3.270.0180.02712.84
5.3.260.0120.03012.83
5.3.250.0100.02012.82
5.3.240.0130.01912.67
5.3.230.0080.03112.80
5.3.220.0140.02912.69
5.3.210.0150.03112.88
5.3.200.0150.02412.75
5.3.190.0170.02812.79
5.3.180.0130.01812.81
5.3.170.0160.02112.86
5.3.160.0150.02112.93
5.3.150.0180.01912.85
5.3.140.0170.01812.85
5.3.130.0190.02712.76
5.3.120.0150.02512.86
5.3.110.0150.01812.84
5.3.100.0110.02012.60
5.3.90.0130.02012.66
5.3.80.0120.02112.54
5.3.70.0110.02012.63
5.3.60.0140.02912.65
5.3.50.0120.01912.60
5.3.40.0140.01712.54
5.3.30.0160.02012.57
5.3.20.0140.03012.42
5.3.10.0150.01912.34
5.3.00.0160.03012.27
5.2.170.0080.02811.58
5.2.160.0170.02411.69
5.2.150.0150.02511.68
5.2.140.0120.02611.64
5.2.130.0130.02011.67
5.2.120.0170.02011.63
5.2.110.0100.01711.65
5.2.100.0140.02611.55
5.2.90.0160.01611.63
5.2.80.0110.02511.60
5.2.70.0090.02111.58
5.2.60.0130.02311.54
5.2.50.0130.02711.69
5.2.40.0170.01311.63
5.2.30.0190.01611.62
5.2.20.0140.02411.50
5.2.10.0070.02111.58
5.2.00.0110.01511.51
5.1.60.0130.02311.22
5.1.50.0110.02111.23
5.1.40.0110.01611.19
5.1.30.0100.02311.32
5.1.20.0090.02311.27
5.1.10.0050.02111.29
5.1.00.0130.02011.23
5.0.50.0090.01711.14
5.0.40.0080.01311.14
5.0.30.0110.02311.14
5.0.20.0090.01511.14
5.0.10.0090.01111.14
5.0.00.0060.02711.14
4.4.90.0060.01211.14
4.4.80.0060.01311.14
4.4.70.0080.01111.14
4.4.60.0030.01311.14
4.4.50.0070.00911.14
4.4.40.0040.01611.14
4.4.30.0050.00511.14
4.4.20.0030.00911.14
4.4.10.0060.01111.14
4.4.00.0100.01311.14
4.3.110.0070.01211.14
4.3.100.0050.00811.14
4.3.90.0070.01211.14
4.3.80.0080.01811.14
4.3.70.0070.00611.14
4.3.60.0070.01311.14
4.3.50.0060.01211.14
4.3.40.0050.02011.14
4.3.30.0030.01411.14
4.3.20.0030.01611.14
4.3.10.0070.01411.14
4.3.00.0030.00911.14

preferences:
45.93 ms | 401 KiB | 5 Q