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.0110.01118.43
8.3.50.0070.01022.12
8.3.40.0070.00718.79
8.3.30.0070.01419.04
8.3.20.0040.00420.16
8.3.10.0000.00923.64
8.3.00.0000.00820.68
8.2.180.0060.00916.75
8.2.170.0070.00722.96
8.2.160.0000.01422.08
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0080.00817.74
8.2.110.0040.00422.30
8.2.100.0040.00817.84
8.2.90.0080.00019.22
8.2.80.0040.00417.97
8.2.70.0030.00617.50
8.2.60.0060.00317.93
8.2.50.0000.00818.07
8.2.40.0030.00719.97
8.2.30.0040.00418.12
8.2.20.0080.00017.81
8.2.10.0040.00417.93
8.2.00.0000.00817.80
8.1.280.0110.00325.92
8.1.270.0080.00024.02
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0050.00522.11
8.1.230.0120.00320.90
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0050.00517.35
8.1.190.0080.00017.30
8.1.180.0040.00418.10
8.1.170.0030.00618.50
8.1.160.0080.00022.04
8.1.150.0040.00418.82
8.1.140.0040.00417.39
8.1.130.0050.00217.63
8.1.120.0000.00717.59
8.1.110.0040.00417.42
8.1.100.0000.00717.39
8.1.90.0070.00017.38
8.1.80.0070.00017.48
8.1.70.0000.00717.35
8.1.60.0040.00417.66
8.1.50.0000.00817.52
8.1.40.0060.00317.53
8.1.30.0060.00317.71
8.1.20.0000.00817.61
8.1.10.0040.00417.44
8.1.00.0080.00017.39
8.0.300.0040.00418.77
8.0.290.0070.00017.28
8.0.280.0000.00718.48
8.0.270.0000.00717.21
8.0.260.0000.00616.80
8.0.250.0000.00617.04
8.0.240.0000.00716.92
8.0.230.0030.00317.07
8.0.220.0000.00716.99
8.0.210.0040.00416.93
8.0.200.0040.00416.93
8.0.190.0040.00417.10
8.0.180.0030.00517.05
8.0.170.0060.00316.93
8.0.160.0000.00716.89
8.0.150.0020.00516.90
8.0.140.0040.00416.86
8.0.130.0050.00013.40
8.0.120.0030.00617.09
8.0.110.0090.00017.04
8.0.100.0040.00416.99
8.0.90.0000.00917.13
8.0.80.0120.00817.18
8.0.70.0030.00617.01
8.0.60.0000.00917.04
8.0.50.0060.00317.08
8.0.30.0090.01417.40
8.0.20.0130.00817.40
8.0.10.0090.00017.28
8.0.00.0140.01216.92
7.4.330.0050.00015.09
7.4.320.0030.00316.55
7.4.300.0000.00616.40
7.4.290.0100.00016.70
7.4.280.0030.00316.48
7.4.270.0000.00616.55
7.4.260.0040.00216.55
7.4.250.0040.00416.68
7.4.240.0040.00516.71
7.4.230.0050.00316.60
7.4.220.0180.00716.74
7.4.210.0100.00816.69
7.4.200.0040.00416.50
7.4.190.0060.00316.91
7.4.160.0040.01416.64
7.4.150.0080.01217.40
7.4.140.0120.00717.86
7.4.130.0080.01116.68
7.4.120.0070.01316.63
7.4.110.0200.00716.72
7.4.100.0100.01016.74
7.4.90.0040.01616.71
7.4.80.0150.00619.39
7.4.70.0080.01316.68
7.4.60.0150.00716.64
7.4.50.0090.00616.54
7.4.40.0050.01419.56
7.4.30.0100.01416.39
7.4.20.0130.00816.67
7.4.10.0050.01816.56
7.4.00.0080.01115.87
7.3.330.0000.00513.20
7.3.320.0030.00313.02
7.3.310.0000.00916.46
7.3.300.0040.00416.36
7.3.290.0040.01216.42
7.3.280.0100.01016.32
7.3.270.0090.00917.40
7.3.260.0060.01316.51
7.3.250.0110.01016.44
7.3.240.0140.01116.26
7.3.230.0110.00716.59
7.3.210.0140.01116.41
7.3.200.0090.00916.31
7.3.190.0060.01516.38
7.3.180.0050.01616.58
7.3.170.0110.00816.38
7.3.160.0100.00916.37
7.3.150.0150.01116.20
7.3.140.0110.00816.35
7.3.130.0060.01216.38
7.3.120.0040.01615.62
7.3.110.0130.01316.30
7.3.100.0100.01016.18
7.3.90.0070.01316.64
7.3.80.0130.00716.36
7.3.70.0100.01016.46
7.3.60.0150.00316.23
7.3.50.0050.01416.24
7.3.40.0140.00716.36
7.3.30.0040.01416.45
7.3.20.0080.01616.22
7.3.10.0080.00916.61
7.3.00.0100.00716.68
7.2.330.0070.01416.72
7.2.320.0110.00816.47
7.2.310.0110.01016.62
7.2.300.0110.00816.36
7.2.290.0070.01316.67
7.2.280.0110.01116.43
7.2.270.0160.01316.48
7.2.260.0140.00816.44
7.2.250.0090.00916.83
7.2.240.0080.01316.55
7.2.230.0060.01416.86
7.2.220.0140.00616.54
7.2.210.0200.02816.43
7.2.200.0110.01116.70
7.2.190.0110.00916.63
7.2.180.0030.01616.52
7.2.170.0060.01616.59
7.2.160.0160.00416.43
7.2.150.0080.01116.68
7.2.140.0140.01216.36
7.2.130.0470.01116.61
7.2.120.0070.01016.61
7.2.110.0120.00616.90
7.2.100.0090.00716.74
7.2.90.0280.00716.88
7.2.80.0080.00916.91
7.2.70.0050.01116.90
7.2.60.0060.01216.88
7.2.50.0080.00816.86
7.2.40.0170.00916.91
7.2.30.0080.01016.87
7.2.20.0080.00916.89
7.2.10.0070.01016.93
7.2.00.0140.00917.34
7.1.330.0180.01315.72
7.1.320.0190.01115.72
7.1.310.0250.00615.83
7.1.300.0230.00815.76
7.1.290.0240.01015.68
7.1.280.0190.01415.48
7.1.270.0210.01115.92
7.1.260.0230.01815.54
7.1.250.0090.00915.75
7.1.240.0160.01615.50
7.1.230.0240.01515.64
7.1.220.0300.00715.72
7.1.210.0220.00715.64
7.1.200.0130.00915.71
7.1.190.0220.00915.67
7.1.180.0260.00615.62
7.1.170.0260.01515.49
7.1.160.0200.01615.70
7.1.150.0260.00615.69
7.1.140.0230.00815.57
7.1.130.0210.01115.68
7.1.120.0230.01215.76
7.1.110.0250.00615.63
7.1.100.0260.01216.91
7.1.90.0260.00815.78
7.1.80.0200.01615.46
7.1.70.0110.01316.29
7.1.60.0140.01617.48
7.1.50.0150.01316.26
7.1.40.0180.01215.82
7.1.30.0240.00615.70
7.1.20.0220.01015.79
7.1.10.0300.00315.56
7.1.00.0130.04319.03
7.0.330.0220.00915.41
7.0.320.0200.01015.42
7.0.310.0200.01315.32
7.0.300.0240.00615.52
7.0.290.0120.01815.43
7.0.280.0200.01115.27
7.0.270.0230.01215.41
7.0.260.0140.01815.47
7.0.250.0160.01315.59
7.0.240.0280.00615.52
7.0.230.0220.01215.38
7.0.220.0340.02015.41
7.0.210.0320.00015.46
7.0.200.0130.00816.12
7.0.190.0250.01115.29
7.0.180.0180.01215.39
7.0.170.0240.01015.48
7.0.160.0430.00715.38
7.0.150.0220.00615.41
7.0.140.0100.04318.74
7.0.130.0180.01015.33
7.0.120.0200.00715.42
7.0.110.0130.05119.51
7.0.100.0220.04518.54
7.0.90.0130.04318.50
7.0.80.0170.04517.72
7.0.70.0170.02717.67
7.0.60.0240.04918.59
7.0.50.0150.02818.58
7.0.40.0170.02418.46
7.0.30.0180.03218.48
7.0.20.0140.04618.51
7.0.10.0110.04518.37
7.0.00.0070.05218.41
5.6.400.0120.01715.69
5.6.390.0140.01716.18
5.6.380.0200.01216.18
5.6.370.0230.01015.93
5.6.360.0190.02316.14
5.6.350.0150.01516.02
5.6.340.0180.01415.83
5.6.330.0280.00616.19
5.6.320.0280.01815.75
5.6.310.0260.00716.11
5.6.300.0180.01415.92
5.6.290.0170.01315.81
5.6.280.0140.04018.40
5.6.270.0220.01115.79
5.6.260.0120.04518.27
5.6.250.0200.05418.48
5.6.240.0110.03318.30
5.6.230.0110.04818.41
5.6.220.0210.03918.29
5.6.210.0140.03918.42
5.6.200.0090.04718.33
5.6.190.0140.02918.29
5.6.180.0110.03818.29
5.6.170.0100.04318.27
5.6.160.0100.04818.37
5.6.150.0120.04718.27
5.6.140.0100.04518.35
5.6.130.0130.04918.35
5.6.120.0060.03918.26
5.6.110.0080.04818.24
5.6.100.0150.02518.32
5.6.90.0110.02918.25
5.6.80.0110.04717.80
5.6.70.0100.02317.91
5.6.60.0120.02317.97
5.6.50.0180.01817.97
5.6.40.0150.04217.99
5.6.30.0150.04117.93
5.6.20.0090.05217.99
5.6.10.0120.04518.00
5.6.00.0150.04317.87
5.5.380.0110.04116.63
5.5.370.0090.04516.78
5.5.360.0150.04316.70
5.5.350.0150.04116.68
5.5.340.0160.03617.26
5.5.330.0120.02617.08
5.5.320.0140.03417.13
5.5.310.0110.05117.04
5.5.300.0120.04817.09
5.5.290.0120.03817.18
5.5.280.0110.03016.99
5.5.270.0100.04817.02
5.5.260.0080.05316.86
5.5.250.0120.05317.08
5.5.240.0180.04216.64
5.5.230.0100.05116.77
5.5.220.0170.04416.74
5.5.210.0080.03816.77
5.5.200.0080.04416.76
5.5.190.0140.04116.68
5.5.180.0100.03516.68
5.5.170.0130.01815.86
5.5.160.0130.03316.83
5.5.150.0080.03016.84
5.5.140.0090.03916.74
5.5.130.0070.05216.73
5.5.120.0100.04716.68
5.5.110.0120.04316.76
5.5.100.0110.04616.57
5.5.90.0140.04016.69
5.5.80.0060.03116.72
5.5.70.0140.04616.73
5.5.60.0070.03616.61
5.5.50.0110.02816.63
5.5.40.0090.03416.55
5.5.30.0070.03616.67
5.5.20.0130.03616.58
5.5.10.0180.03516.67
5.5.00.0200.03916.65
5.4.450.0100.03716.08
5.4.440.0150.03216.01
5.4.430.0080.03816.10
5.4.420.0090.02216.07
5.4.410.0180.02915.97
5.4.400.0150.03815.85
5.4.390.0130.02715.85
5.4.380.0110.02015.89
5.4.370.0110.02915.93
5.4.360.0110.04015.99
5.4.350.0100.03315.74
5.4.340.0120.03815.76
5.4.330.0150.00612.32
5.4.320.0100.04016.00
5.4.310.0070.02415.81
5.4.300.0100.02015.89
5.4.290.0130.03715.91
5.4.280.0070.04215.99
5.4.270.0090.04015.83
5.4.260.0080.04215.89
5.4.250.0070.03115.93
5.4.240.0110.02115.74
5.4.230.0130.03415.82
5.4.220.0110.04115.88
5.4.210.0050.02715.77
5.4.200.0110.03315.73
5.4.190.0110.04415.87
5.4.180.0080.04215.74
5.4.170.0120.03915.71
5.4.160.0070.03915.86
5.4.150.0070.02715.79
5.4.140.0120.03314.56
5.4.130.0100.02114.63
5.4.120.0140.02314.56
5.4.110.0070.02514.38
5.4.100.0100.02514.60
5.4.90.0130.02214.55
5.4.80.0150.01814.53
5.4.70.0090.02314.62
5.4.60.0120.01814.53
5.4.50.0090.02314.59
5.4.40.0100.02114.59
5.4.30.0080.02614.46
5.4.20.0070.02414.52
5.4.10.0110.02114.44
5.4.00.0060.02414.22
5.3.290.0100.04314.02
5.3.280.0110.04413.88
5.3.270.0100.02913.92
5.3.260.0150.03213.83
5.3.250.0100.02613.95
5.3.240.0090.02613.84
5.3.230.0110.02913.87
5.3.220.0080.02513.80
5.3.210.0140.02313.86
5.3.200.0110.02713.81
5.3.190.0080.02413.88
5.3.180.0090.02313.88
5.3.170.0100.02713.98
5.3.160.0080.02514.00
5.3.150.0080.02414.04
5.3.140.0090.02613.95
5.3.130.0130.02113.93
5.3.120.0120.02513.91
5.3.110.0130.02713.95
5.3.100.0090.02313.67
5.3.90.0100.02213.63
5.3.80.0090.02113.63
5.3.70.0070.02313.60
5.3.60.0050.03813.54
5.3.50.0110.02413.69
5.3.40.0060.02513.53
5.3.30.0100.02313.52
5.3.20.0080.02513.59
5.3.10.0140.01513.32
5.3.00.0080.02213.39
5.2.170.0070.01911.67
5.2.160.0090.01611.74
5.2.150.0100.01611.67
5.2.140.0060.02111.65
5.2.130.0060.01911.63
5.2.120.0020.02211.62
5.2.110.0040.02311.67
5.2.100.0080.01711.64
5.2.90.0070.01711.64
5.2.80.0030.02211.63
5.2.70.0090.01811.65
5.2.60.0050.01811.58
5.2.50.0070.02011.61
5.2.40.0050.01911.66
5.2.30.0060.01611.51
5.2.20.0130.01611.51
5.2.10.0120.01211.50
5.2.00.0100.01811.40
5.1.60.0070.01511.06
5.1.50.0040.02011.02
5.1.40.0050.01511.00
5.1.30.0040.01711.20
5.1.20.0080.01311.19
5.1.10.0080.01711.10
5.1.00.0040.01711.09
5.0.50.0050.01410.43
5.0.40.0000.01610.23
5.0.30.0070.01510.14
5.0.20.0060.01010.13
5.0.10.0070.01210.15
5.0.00.0030.01910.19
4.4.90.0030.0089.63
4.4.80.0030.0089.63
4.4.70.0010.0109.63
4.4.60.0050.0079.63
4.4.50.0010.0119.63
4.4.40.0050.0139.63
4.4.30.0010.0099.63
4.4.20.0020.0149.63
4.4.10.0050.0079.63
4.4.00.0030.0119.63
4.3.110.0050.0079.63
4.3.100.0060.0059.63
4.3.90.0020.0099.63
4.3.80.0020.0149.63
4.3.70.0030.0089.63
4.3.60.0050.0079.63
4.3.50.0020.0099.63
4.3.40.0050.0109.63
4.3.30.0050.0059.63
4.3.20.0000.0109.63
4.3.10.0020.0089.63
4.3.00.0020.0099.63

preferences:
33.32 ms | 401 KiB | 5 Q