3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = "°Freen\x18 ew°\x90ɮ\x7F\xc2"; $result="\xC2"; //$result = preg_replace('~[\x{0000}-\x{000F}\x{007F}-\x{00a0}]~S', '', $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.0090.00618.30
8.3.50.0080.00821.99
8.3.40.0040.01118.67
8.3.30.0070.00718.84
8.3.20.0000.00818.89
8.3.10.0040.00421.10
8.3.00.0080.00021.82
8.2.180.0120.00316.88
8.2.170.0090.00622.96
8.2.160.0140.00720.47
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0000.00721.25
8.2.110.0060.00320.43
8.2.100.0220.00417.67
8.2.90.0000.00818.03
8.2.80.0040.00417.97
8.2.70.0040.00417.73
8.2.60.0000.00817.80
8.2.50.0060.00318.07
8.2.40.0030.00618.24
8.2.30.0040.00419.48
8.2.20.0080.00017.84
8.2.10.0040.00417.97
8.2.00.0040.00417.78
8.1.280.0090.00925.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0070.00322.10
8.1.230.0090.00322.64
8.1.220.0080.00017.79
8.1.210.0060.00618.94
8.1.200.0080.00317.35
8.1.190.0060.00317.53
8.1.180.0080.00018.10
8.1.170.0040.00418.78
8.1.160.0050.00218.85
8.1.150.0050.00318.82
8.1.140.0000.00717.50
8.1.130.0030.00317.87
8.1.120.0040.00417.70
8.1.110.0040.00417.55
8.1.100.0040.00417.55
8.1.90.0000.00717.61
8.1.80.0000.00717.63
8.1.70.0000.00717.49
8.1.60.0060.00317.63
8.1.50.0040.00417.58
8.1.40.0030.00617.70
8.1.30.0030.00517.77
8.1.20.0040.00417.81
8.1.10.0050.00317.68
8.1.00.0030.00917.58
8.0.300.0070.00020.09
8.0.290.0040.00417.30
8.0.280.0080.00018.54
8.0.270.0000.00717.17
8.0.260.0000.00716.91
8.0.250.0000.00817.02
8.0.240.0090.00017.01
8.0.230.0050.00216.95
8.0.220.0000.00717.04
8.0.210.0030.00617.06
8.0.200.0030.00317.07
8.0.190.0000.00817.04
8.0.180.0020.00516.90
8.0.170.0040.00417.05
8.0.160.0040.00417.02
8.0.150.0040.00416.84
8.0.140.0030.00616.87
8.0.130.0030.00313.47
8.0.120.0000.00716.96
8.0.110.0040.00416.92
8.0.100.0000.00817.02
8.0.90.0040.00416.87
8.0.80.0110.00317.00
8.0.70.0000.00716.95
8.0.60.0000.00716.95
8.0.50.0000.00716.86
8.0.30.0130.00817.26
8.0.20.0120.00917.40
8.0.10.0030.00417.13
8.0.00.0120.00916.85
7.4.330.0000.00516.68
7.4.320.0030.00316.84
7.4.300.0070.00016.71
7.4.290.0040.00416.86
7.4.280.0030.00316.72
7.4.270.0030.00316.88
7.4.260.0000.00513.50
7.4.250.0050.00316.80
7.4.240.0040.00416.84
7.4.230.0070.00016.86
7.4.220.0070.01316.59
7.4.210.0080.00916.77
7.4.200.0000.00716.72
7.4.190.0070.00016.87
7.4.160.0060.01016.57
7.4.150.0090.00917.40
7.4.140.0090.00817.86
7.4.130.0150.00516.88
7.4.120.0110.00716.68
7.4.110.0180.00316.43
7.4.100.0100.00916.77
7.4.90.0090.00916.77
7.4.80.0000.01819.39
7.4.70.0130.00316.98
7.4.60.0030.01416.73
7.4.50.0030.00616.86
7.4.40.0070.01122.77
7.4.30.0080.01516.68
7.4.00.0060.01015.40
7.3.330.0050.00013.26
7.3.320.0000.00513.20
7.3.310.0000.00816.41
7.3.300.0070.00016.34
7.3.290.0100.00716.39
7.3.280.0110.00616.38
7.3.270.0100.00717.40
7.3.260.0150.00518.24
7.3.250.0100.00916.54
7.3.240.0100.00716.38
7.3.230.0030.01416.73
7.3.210.0030.01516.81
7.3.200.0120.00919.39
7.3.190.0130.00916.33
7.3.180.0080.00816.52
7.3.170.0090.00616.54
7.3.160.0060.01016.67
7.3.120.0130.00314.79
7.3.10.0260.00016.41
7.3.00.0040.00916.58
7.2.330.0090.00916.60
7.2.320.0070.01316.56
7.2.310.0090.01616.90
7.2.300.0070.01116.85
7.2.290.0070.01016.63
7.2.130.0160.00717.00
7.2.120.0120.00616.68
7.2.110.0180.00616.88
7.2.100.0080.01116.55
7.2.90.0140.00716.92
7.2.80.0220.00316.74
7.2.70.0080.01116.85
7.2.60.0210.00316.53
7.2.50.0270.00316.69
7.2.40.0100.01017.07
7.2.30.0200.00016.52
7.2.20.0130.00316.72
7.2.10.0080.00816.90
7.2.00.0040.01116.81
7.1.250.0130.00715.81
7.1.70.0000.01017.27
7.1.60.0110.01419.17
7.1.50.0060.01917.13
7.1.00.0030.03322.46
7.0.200.0180.00715.11
7.0.140.0000.07722.21
7.0.100.0400.07719.93
7.0.90.0330.08319.91
7.0.80.0400.07720.00
7.0.70.0400.04319.86
7.0.60.0300.08319.86
7.0.50.0330.06720.36
7.0.40.0000.09020.08
7.0.30.0170.08020.05
7.0.20.0030.07720.00
7.0.10.0200.07020.10
7.0.00.0030.08020.04
5.6.280.0100.06720.86
5.6.250.0200.07320.49
5.6.240.0070.08020.63
5.6.230.0170.07020.59
5.6.220.0030.08020.58
5.6.210.0000.08320.67
5.6.200.0070.08721.02
5.6.190.0130.04321.03
5.6.180.0130.07721.08
5.6.170.0070.06021.02
5.6.160.0070.08021.07
5.6.150.0070.08721.00
5.6.140.0070.04021.00
5.6.130.0100.06721.10
5.6.120.0070.08020.98
5.6.110.0200.05021.02
5.6.100.0130.05020.99
5.6.90.0130.08321.09
5.6.80.0070.07720.45
5.6.70.0100.07720.54
5.6.60.0100.06720.35
5.6.50.0000.05020.45
5.6.40.0100.04320.41
5.6.30.0200.05720.52
5.6.20.0130.06320.34
5.6.10.0130.06720.51
5.6.00.0070.07320.37
5.5.380.0200.07020.36
5.5.370.0100.07720.36
5.5.360.0100.07720.38
5.5.350.0030.04020.39
5.5.340.0200.07720.93
5.5.330.0100.07020.81
5.5.320.0030.07020.86
5.5.310.0130.04320.77
5.5.300.0070.07320.76
5.5.290.0130.06020.90
5.5.280.0070.07720.83
5.5.270.0070.08320.64
5.5.260.0130.08320.89
5.5.250.0070.08320.43
5.5.240.0100.05020.13
5.5.230.0070.08320.15
5.5.220.0170.06320.28
5.5.210.0030.04720.29
5.5.200.0100.07720.22
5.5.190.0030.08720.18
5.5.180.0070.07720.18
5.5.160.0130.07320.18
5.5.150.0170.07320.23
5.5.140.0130.05320.26
5.5.130.0170.06020.11
5.5.120.0070.06020.20
5.5.110.0030.05020.23
5.5.100.0070.04020.14
5.5.90.0100.07320.04
5.5.80.0030.07720.05
5.5.70.0100.07320.06
5.5.60.0100.03720.03
5.5.50.0070.07720.14
5.5.40.0030.07020.07
5.5.30.0070.07020.05
5.5.20.0100.07020.09
5.5.10.0000.07720.05
5.5.00.0100.07019.97
5.4.450.0130.06719.38
5.4.440.0000.10019.35
5.4.430.0000.08319.22
5.4.420.0100.04019.46
5.4.410.0100.07719.23
5.4.400.0000.08018.98
5.4.390.0030.05018.81
5.4.380.0000.05019.07
5.4.370.0130.06319.14
5.4.360.0100.03318.96
5.4.350.0000.04719.11
5.4.340.0170.07019.11
5.4.320.0130.07019.10
5.4.310.0100.04018.81
5.4.300.0030.07319.12
5.4.290.0130.06318.78
5.4.280.0070.06318.97
5.4.270.0170.07019.05
5.4.260.0100.04719.07
5.4.250.0100.07319.09
5.4.240.0170.06719.02
5.4.230.0000.08018.80
5.4.220.0070.08019.09
5.4.210.0100.04319.02
5.4.200.0100.07019.04
5.4.190.0070.07319.13
5.4.180.0130.06719.04
5.4.170.0200.06018.93
5.4.160.0030.04718.88
5.4.150.0030.07319.09
5.4.140.0130.06716.29
5.4.130.0030.07316.18
5.4.120.0070.06316.32
5.4.110.0100.07016.23
5.4.100.0100.07716.21
5.4.90.0030.04316.41
5.4.80.0130.04716.33
5.4.70.0130.03716.33
5.4.60.0070.06316.23
5.4.50.0070.03316.27
5.4.40.0030.03716.37
5.4.30.0100.04016.39
5.4.20.0030.03316.38
5.4.10.0070.03316.27
5.4.00.0030.03315.81
5.3.290.0030.08014.60
5.3.280.0100.03714.55
5.3.270.0070.07314.58
5.3.260.0070.08014.56
5.3.250.0000.04314.61
5.3.240.0100.03714.46
5.3.230.0170.06014.60
5.3.220.0100.05314.42
5.3.210.0100.07014.55
5.3.200.0130.06014.57
5.3.190.0030.04014.54
5.3.180.0070.03314.47
5.3.170.0170.06714.42
5.3.160.0070.04714.50
5.3.150.0070.05014.56
5.3.140.0170.03014.41
5.3.130.0100.06714.52
5.3.120.0100.03314.48
5.3.110.0100.03014.40
5.3.100.0030.03713.89
5.3.90.0100.03013.87
5.3.80.0030.03313.79
5.3.70.0030.04714.01
5.3.60.0000.03713.94
5.3.50.0100.02713.93
5.3.40.0030.03713.90
5.3.30.0070.03313.84
5.3.20.0130.02313.45
5.3.10.0030.06713.63
5.3.00.0070.05713.57
5.2.170.0030.02710.96
5.2.160.0000.03310.98
5.2.150.0030.03311.10
5.2.140.0030.02711.20
5.2.130.0070.02310.89
5.2.120.0100.02011.14
5.2.110.0170.05011.11
5.2.100.0070.02311.02
5.2.90.0000.06711.05
5.2.80.0000.06311.04
5.2.70.0000.04311.09
5.2.60.0030.03010.85
5.2.50.0000.04311.08
5.2.40.0030.03310.86
5.2.30.0000.03010.92
5.2.20.0000.03711.00
5.2.10.0000.03310.91
5.2.00.0000.02710.75
5.1.60.0000.02710.06
5.1.50.0000.02310.02
5.1.40.0000.0339.99
5.1.30.0030.03710.26
5.1.20.0030.03010.36
5.1.10.0000.02710.06
5.1.00.0000.0379.99
5.0.50.0000.0239.99
5.0.40.0000.0209.99
5.0.30.0000.0339.99
5.0.20.0000.0209.99
5.0.10.0030.0179.99
5.0.00.0030.0279.99
4.4.90.0030.0339.99
4.4.80.0000.0409.99
4.4.70.0030.0339.99
4.4.60.0000.0179.99
4.4.50.0000.0179.99
4.4.40.0000.0239.99
4.4.30.0030.0209.99
4.4.20.0000.0179.99
4.4.10.0000.0179.99
4.4.00.0030.0239.99
4.3.110.0030.0179.99
4.3.100.0030.0139.99
4.3.90.0000.0179.99
4.3.80.0000.0239.99
4.3.70.0000.0139.99
4.3.60.0000.0139.99
4.3.50.0030.0139.99
4.3.40.0030.0209.99
4.3.30.0000.0179.99
4.3.20.0030.0139.99
4.3.10.0000.0139.99
4.3.00.0000.0139.99

preferences:
43.66 ms | 401 KiB | 5 Q