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; echo @iconv("UTF-8", "UTF-8//IGNORE", $result); exit; 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); $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.0170.00016.50
8.3.50.0100.00922.04
8.3.40.0150.00618.85
8.3.30.0070.01019.05
8.3.20.0040.00420.20
8.3.10.0000.00823.66
8.3.00.0030.00619.18
8.2.180.0130.00716.63
8.2.170.0160.00022.96
8.2.160.0070.00720.36
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0130.01026.16
8.2.120.0000.00822.26
8.2.110.0070.00321.08
8.2.100.0000.01217.84
8.2.90.0040.00417.84
8.2.80.0060.00318.98
8.2.70.0080.00017.80
8.2.60.0040.00417.93
8.2.50.0060.00318.10
8.2.40.0000.00720.61
8.2.30.0000.00718.11
8.2.20.0050.00217.91
8.2.10.0050.00318.30
8.2.00.0050.00217.75
8.1.280.0170.00025.92
8.1.270.0100.01023.79
8.1.260.0060.00326.35
8.1.250.0060.00328.09
8.1.240.0080.00022.15
8.1.230.0070.00320.89
8.1.220.0040.00417.77
8.1.210.0080.00018.77
8.1.200.0060.00317.22
8.1.190.0040.00417.35
8.1.180.0080.00018.10
8.1.170.0090.00018.50
8.1.160.0040.00422.17
8.1.150.0040.00418.73
8.1.140.0000.00817.43
8.1.130.0080.00017.94
8.1.120.0040.00417.47
8.1.110.0070.00317.54
8.1.100.0000.00817.51
8.1.90.0030.00517.52
8.1.80.0000.00717.55
8.1.70.0000.00717.41
8.1.60.0000.00917.59
8.1.50.0040.00417.58
8.1.40.0040.00417.54
8.1.30.0030.00617.67
8.1.20.0040.00417.71
8.1.10.0000.00817.45
8.1.00.0050.00317.46
8.0.300.0070.00320.16
8.0.290.0040.00416.88
8.0.280.0000.00718.36
8.0.270.0030.00617.18
8.0.260.0030.00316.87
8.0.250.0030.00317.06
8.0.240.0030.00316.97
8.0.230.0040.00417.04
8.0.220.0040.00416.89
8.0.210.0080.00017.04
8.0.200.0000.00717.06
8.0.190.0000.00716.94
8.0.180.0000.00816.98
8.0.170.0040.00416.91
8.0.160.0040.00417.03
8.0.150.0000.00816.98
8.0.140.0000.00816.89
8.0.130.0060.00013.41
8.0.120.0000.00917.00
8.0.110.0000.00916.97
8.0.100.0060.00317.03
8.0.90.0060.00317.10
8.0.80.0000.01717.16
8.0.70.0030.00717.14
8.0.60.0060.00317.10
8.0.50.0060.00316.93
8.0.30.0090.01317.19
8.0.20.0170.00817.40
8.0.10.0060.00317.09
8.0.00.0140.01717.23
7.4.330.0000.00515.08
7.4.320.0000.00616.41
7.4.300.0000.00616.67
7.4.290.0040.00416.53
7.4.280.0030.00316.56
7.4.270.0030.00316.66
7.4.260.0070.00016.67
7.4.250.0080.00016.84
7.4.240.0030.00516.82
7.4.230.0040.00416.89
7.4.220.0070.01316.64
7.4.210.0070.01316.83
7.4.200.0000.00916.90
7.4.190.0000.00816.85
7.4.160.0140.00516.55
7.4.150.0090.01117.40
7.4.140.0120.00717.86
7.4.130.0100.01016.66
7.4.120.0050.01416.74
7.4.110.0130.01016.65
7.4.100.0060.01616.62
7.4.90.0150.00616.78
7.4.80.0060.01219.39
7.4.70.0100.00916.66
7.4.60.0110.01216.59
7.4.50.0050.01116.61
7.4.40.0100.01019.53
7.4.30.0090.00916.41
7.4.20.0100.01416.33
7.4.10.0060.01315.56
7.4.00.0110.00815.40
7.3.330.0050.00013.12
7.3.320.0000.00613.01
7.3.310.0040.00416.32
7.3.300.0040.00416.39
7.3.290.0080.00816.41
7.3.280.0090.01216.38
7.3.270.0070.01317.40
7.3.260.0090.00916.54
7.3.250.0090.01016.62
7.3.240.0110.02016.22
7.3.230.0060.01916.56
7.3.210.0130.00616.47
7.3.200.0090.00916.51
7.3.190.0090.01416.42
7.3.180.0110.00716.44
7.3.170.0100.01016.43
7.3.160.0110.01016.42
7.3.150.0140.01216.33
7.3.140.0100.01216.72
7.3.130.0070.01215.34
7.3.120.0100.01015.21
7.3.110.0050.01415.35
7.3.100.0070.01115.32
7.3.90.0090.00815.30
7.3.80.0060.00715.46
7.3.70.0030.01215.42
7.3.60.0090.00815.39
7.3.50.0100.00615.35
7.3.40.0060.00915.39
7.3.30.0070.00915.39
7.3.20.0080.01017.19
7.3.10.0090.01016.94
7.3.00.0060.01016.89
7.2.330.0030.01716.74
7.2.320.0030.01616.64
7.2.310.0070.01216.66
7.2.300.0090.01116.69
7.2.290.0100.01416.73
7.2.280.0080.01216.69
7.2.270.0130.00816.41
7.2.260.0050.01515.63
7.2.250.0080.01315.60
7.2.240.0060.01315.52
7.2.230.0060.01115.67
7.2.220.0050.01015.63
7.2.210.0030.01215.60
7.2.200.0080.01015.59
7.2.190.0050.01315.51
7.2.180.0050.01115.57
7.2.170.0070.00915.51
7.2.160.0060.01115.42
7.2.150.0030.01317.55
7.2.140.0050.01117.37
7.2.130.0100.00617.15
7.2.120.0090.01117.18
7.2.110.0080.01317.05
7.2.100.0070.01117.08
7.2.90.0070.01417.34
7.2.80.0120.01217.36
7.2.70.0140.01017.31
7.2.60.0100.00816.99
7.2.50.0100.01117.14
7.2.40.0130.01417.26
7.2.30.0110.01017.32
7.2.20.0070.01317.10
7.2.10.0150.00817.24
7.2.00.0100.01017.65
7.1.330.0170.00616.25
7.1.320.0100.00816.29
7.1.310.0080.00816.29
7.1.300.0050.01216.32
7.1.290.0050.00716.23
7.1.280.0070.01116.30
7.1.270.0070.01116.31
7.1.260.0070.01016.38
7.1.250.0120.00816.07
7.1.240.0090.01116.36
7.1.230.0110.00916.42
7.1.220.0070.01216.33
7.1.210.0130.01216.42
7.1.200.0100.01216.18
7.1.190.0030.01616.38
7.1.180.0110.00916.40
7.1.170.0100.00816.22
7.1.160.0150.00916.27
7.1.150.0100.01116.31
7.1.140.0120.00716.40
7.1.130.0070.01116.28
7.1.120.0080.01016.19
7.1.110.0060.01116.37
7.1.100.0050.01316.86
7.1.90.0130.01316.26
7.1.80.0150.00816.46
7.1.70.0110.00816.61
7.1.60.0100.00817.11
7.1.50.0100.01116.54
7.1.40.0120.01116.19
7.1.30.0080.01316.44
7.1.20.0090.01516.03
7.1.10.0100.01216.24
7.1.00.0040.02817.89
7.0.330.0080.01015.91
7.0.320.0100.01415.94
7.0.310.0090.01516.09
7.0.300.0110.00915.92
7.0.290.0090.01216.21
7.0.280.0050.00916.00
7.0.270.0080.00816.01
7.0.260.0040.01515.92
7.0.250.0060.00916.04
7.0.240.0100.01216.18
7.0.230.0120.00715.91
7.0.220.0100.01216.00
7.0.210.0110.00916.07
7.0.200.0060.01416.04
7.0.190.0170.00616.02
7.0.180.0070.00916.11
7.0.170.0080.00715.93
7.0.160.0120.00916.07
7.0.150.0100.01016.06
7.0.140.0060.02917.57
7.0.130.0100.00515.87
7.0.120.0070.00715.95
7.0.110.0060.01015.90
7.0.100.0090.00916.12
7.0.90.0090.00816.15
7.0.80.0100.00816.08
7.0.70.0080.02017.37
7.0.60.0070.02117.48
7.0.50.0090.01817.61
7.0.40.0120.01516.14
7.0.30.0080.02516.12
7.0.20.0110.02416.11
7.0.10.0050.03016.18
7.0.00.0120.02816.01
5.6.400.0080.01015.01
5.6.390.0060.01314.92
5.6.380.0110.01214.85
5.6.370.0090.01514.91
5.6.360.0060.01315.10
5.6.350.0070.01415.08
5.6.340.0070.01314.84
5.6.330.0080.00914.97
5.6.320.0060.01314.93
5.6.310.0120.01114.84
5.6.300.0110.01214.88
5.6.290.0080.01215.09
5.6.280.0060.02816.58
5.6.270.0060.01015.04
5.6.260.0060.01214.97
5.6.250.0090.01114.97
5.6.240.0060.01215.01
5.6.230.0080.00914.96
5.6.220.0090.02716.29
5.6.210.0070.02716.37
5.6.200.0100.02216.42
5.6.190.0050.02916.40
5.6.180.0070.02816.37
5.6.170.0040.02716.54
5.6.160.0130.01916.62
5.6.150.0150.02416.64
5.6.140.0080.02416.49
5.6.130.0090.02816.64
5.6.120.0090.02916.52
5.6.110.0050.03216.38
5.6.100.0070.02316.39
5.6.90.0110.02716.43
5.6.80.0070.02716.21
5.6.70.0110.02716.34
5.6.60.0010.02216.31
5.6.50.0040.02916.17
5.6.40.0100.03016.27
5.6.30.0080.02516.33
5.6.20.0090.01916.21
5.6.10.0080.02516.17
5.6.00.0130.02316.27
5.5.380.0090.01314.74
5.5.370.0080.01114.90
5.5.360.0060.03116.27
5.5.350.0090.01916.35
5.5.340.0080.02316.43
5.5.330.0070.02516.45
5.5.320.0060.03016.37
5.5.310.0080.02416.43
5.5.300.0110.02916.31
5.5.290.0080.02716.47
5.5.280.0090.02316.25
5.5.270.0080.02316.26
5.5.260.0060.03116.49
5.5.250.0090.02716.39
5.5.240.0100.02616.24
5.5.230.0080.02716.13
5.5.220.0090.01416.24
5.5.210.0130.02516.27
5.5.200.0080.02916.28
5.5.190.0070.01916.10
5.5.180.0080.02816.22
5.5.170.0080.01414.86
5.5.160.0110.01816.19
5.5.150.0070.02716.33
5.5.140.0060.02416.06
5.5.130.0060.02816.33
5.5.120.0090.02316.13
5.5.110.0110.02816.21
5.5.100.0110.02716.06
5.5.90.0100.02816.11
5.5.80.0120.02216.09
5.5.70.0080.02816.13
5.5.60.0050.02216.21
5.5.50.0030.02916.22
5.5.40.0070.02116.10
5.5.30.0110.02416.07
5.5.20.0090.02616.20
5.5.10.0130.02616.16
5.5.00.0060.02616.14
5.4.450.0060.02413.57
5.4.440.0060.02513.60
5.4.430.0060.02513.66
5.4.420.0060.02613.63
5.4.410.0020.02713.66
5.4.400.0100.01313.42
5.4.390.0070.02013.49
5.4.380.0060.02213.53
5.4.370.0060.02713.55
5.4.360.0050.01713.56
5.4.350.0060.02513.53
5.4.340.0090.02013.52
5.4.330.0100.00811.57
5.4.320.0100.02213.49
5.4.310.0060.02413.50
5.4.300.0060.02313.43
5.4.290.0090.02613.47
5.4.280.0070.02513.43
5.4.270.0110.02213.43
5.4.260.0030.02613.49
5.4.250.0070.02013.44
5.4.240.0080.02513.43
5.4.230.0090.01913.45
5.4.220.0040.01613.43
5.4.210.0070.01913.55
5.4.200.0070.01813.46
5.4.190.0100.02013.51
5.4.180.0050.02413.50
5.4.170.0090.02013.47
5.4.160.0080.01613.42
5.4.150.0070.02113.49
5.4.140.0040.02812.79
5.4.130.0090.01712.79
5.4.120.0070.02112.75
5.4.110.0090.02312.86
5.4.100.0060.02412.80
5.4.90.0050.02112.85
5.4.80.0070.01912.77
5.4.70.0040.02012.79
5.4.60.0050.02212.78
5.4.50.0060.02612.88
5.4.40.0060.02212.87
5.4.30.0070.02212.77
5.4.20.0050.01712.84
5.4.10.0040.01912.77
5.4.00.0040.02012.66
5.3.290.0070.02712.54
5.3.280.0080.02312.44
5.3.270.0050.02412.47
5.3.260.0080.02412.46
5.3.250.0080.02912.47
5.3.240.0130.01612.40
5.3.230.0060.02012.43
5.3.220.0030.02612.45
5.3.210.0070.02512.37
5.3.200.0060.02512.39
5.3.190.0040.02612.45
5.3.180.0060.02612.42
5.3.170.0090.02312.48
5.3.160.0060.02212.51
5.3.150.0050.02112.53
5.3.140.0050.03112.51
5.3.130.0050.02812.45
5.3.120.0040.02712.45
5.3.110.0050.02012.53
5.3.100.0070.02412.28
5.3.90.0060.02312.36
5.3.80.0040.02512.27
5.3.70.0070.02012.25
5.3.60.0040.01712.34
5.3.50.0040.02612.32
5.3.40.0050.02512.23
5.3.30.0050.02212.17
5.3.20.0050.02512.10
5.3.10.0050.02312.20
5.3.00.0030.02112.09
5.2.170.0030.03812.20
5.2.160.0040.02812.25
5.2.150.0060.02812.20
5.2.140.0060.03612.23
5.2.130.0040.03712.31
5.2.120.0120.03212.23
5.2.110.0000.02612.19
5.2.100.0020.02912.19
5.2.90.0030.03912.16
5.2.80.0050.03912.19
5.2.70.0100.03712.12
5.2.60.0080.03312.16
5.2.50.0040.03112.15
5.2.40.0020.03712.21
5.2.30.0060.03812.14
5.2.20.0000.03712.11
5.2.10.0080.02312.09
5.2.00.0030.02212.08
5.1.60.0020.03312.08
5.1.50.0000.02812.08
5.1.40.0020.03312.08
5.1.30.0030.02912.08
5.1.20.0030.03612.08
5.1.10.0070.03012.08
5.1.00.0080.02912.08
5.0.50.0030.03012.08
5.0.40.0050.02312.08
5.0.30.0030.03612.08
5.0.20.0030.02612.08
5.0.10.0030.02212.08
5.0.00.0030.02512.08
4.4.90.0050.01712.08
4.4.80.0010.01512.08
4.4.70.0000.01912.08
4.4.60.0010.01512.08
4.4.50.0000.02112.08
4.4.40.0020.02812.08
4.4.30.0000.02112.08
4.4.20.0020.01812.08
4.4.10.0040.01612.08
4.4.00.0020.03212.08
4.3.110.0030.01812.08
4.3.100.0040.01612.08
4.3.90.0010.02112.08
4.3.80.0000.03112.08
4.3.70.0000.02112.08
4.3.60.0020.02012.08
4.3.50.0010.02012.08
4.3.40.0030.02612.08
4.3.30.0020.02012.08
4.3.20.0060.01712.08
4.3.10.0030.01512.08
4.3.00.0020.01112.08

preferences:
33.22 ms | 401 KiB | 5 Q