3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = "°Freen\x18 ew°\x90ɮ\x7F\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); $result = preg_replace("#[\xC2-\xDF][\x80-\xBF]#" ,"",$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 ); */ echo $string;

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.70.0120.00316.58
8.3.60.0070.00718.27
8.3.50.0180.00222.11
8.3.40.0110.00418.79
8.3.30.0090.00618.86
8.3.20.0040.00418.90
8.3.10.0030.00619.39
8.3.00.0050.00321.77
8.2.180.0100.01016.63
8.2.170.0040.01122.96
8.2.160.0100.00320.25
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0090.00026.16
8.2.120.0040.00419.56
8.2.110.0110.00020.43
8.2.100.0060.00617.97
8.2.90.0040.00419.22
8.2.80.0000.00817.97
8.2.70.0000.00917.75
8.2.60.0000.00817.93
8.2.50.0050.00318.07
8.2.40.0000.00817.91
8.2.30.0040.00419.37
8.2.20.0040.00417.76
8.2.10.0040.00417.87
8.2.00.0080.00017.89
8.1.280.0120.00625.92
8.1.270.0000.00823.99
8.1.260.0090.00926.35
8.1.250.0000.00828.09
8.1.240.0060.00322.54
8.1.230.0030.00720.97
8.1.220.0040.00418.77
8.1.210.0050.00318.98
8.1.200.0000.00917.35
8.1.190.0030.00717.43
8.1.180.0030.00518.10
8.1.170.0090.00018.57
8.1.160.0070.00018.89
8.1.150.0070.00318.68
8.1.140.0040.00417.54
8.1.130.0030.00317.80
8.1.120.0000.01017.60
8.1.110.0040.00417.54
8.1.100.0000.00717.48
8.1.90.0040.00417.59
8.1.80.0040.00417.59
8.1.70.0000.00817.48
8.1.60.0030.00617.59
8.1.50.0000.00717.64
8.1.40.0030.00617.49
8.1.30.0080.00017.73
8.1.20.0000.00817.79
8.1.10.0040.00417.63
8.1.00.0050.00317.64
8.0.300.0000.00820.10
8.0.290.0040.00417.05
8.0.280.0040.00418.50
8.0.270.0030.00317.21
8.0.260.0050.00316.91
8.0.250.0000.00717.14
8.0.240.0070.00017.11
8.0.230.0030.00317.11
8.0.220.0000.00717.02
8.0.210.0080.00017.01
8.0.200.0060.00017.07
8.0.190.0050.00517.10
8.0.180.0000.00717.02
8.0.170.0000.01116.94
8.0.160.0030.00316.94
8.0.150.0040.00416.95
8.0.140.0070.00016.96
8.0.130.0000.00613.44
8.0.120.0000.00817.04
8.0.110.0000.00816.89
8.0.100.0000.00717.07
8.0.90.0040.00416.96
8.0.80.0130.00316.95
8.0.70.0000.00816.90
8.0.60.0080.00016.91
8.0.50.0030.00616.86
8.0.30.0030.01617.15
8.0.20.0130.01317.40
8.0.10.0000.00717.00
8.0.00.0040.01516.80
7.4.330.0050.00015.04
7.4.320.0000.00716.77
7.4.300.0040.00416.78
7.4.290.0000.00716.61
7.4.280.0000.00816.68
7.4.270.0080.00016.70
7.4.260.0030.00313.44
7.4.250.0000.00716.75
7.4.240.0000.00716.82
7.4.230.0000.00716.71
7.4.220.0030.02216.77
7.4.210.0060.01016.76
7.4.200.0050.00316.89
7.4.190.0050.00316.91
7.4.160.0080.00816.69
7.4.150.0070.01417.40
7.4.140.0160.00417.86
7.4.130.0080.00916.53
7.4.120.0110.00616.68
7.4.110.0140.00316.62
7.4.100.0060.01616.68
7.4.90.0310.02116.61
7.4.80.0120.00819.39
7.4.70.0110.00716.66
7.4.60.0130.01016.73
7.4.50.0060.00316.78
7.4.40.0040.01522.52
7.4.30.0160.00016.74
7.4.00.0080.01115.14
7.3.330.0000.00513.30
7.3.320.0030.00313.28
7.3.310.0050.00216.34
7.3.300.0030.00316.44
7.3.290.0100.00316.33
7.3.280.0070.01016.35
7.3.270.0040.01317.40
7.3.260.0120.01018.24
7.3.250.0090.00916.67
7.3.240.0060.01016.36
7.3.230.0070.01016.39
7.3.210.0060.01016.37
7.3.200.0040.01219.39
7.3.190.0080.00816.57
7.3.180.0030.01216.70
7.3.170.0100.00716.41
7.3.160.0060.01016.60
7.3.120.0100.00314.89
7.3.110.0100.00314.97
7.3.100.0100.00714.76
7.3.90.0000.01614.91
7.3.80.0070.01014.91
7.3.70.0000.00915.04
7.3.60.0110.00015.08
7.3.50.0060.01015.00
7.3.40.0090.00314.82
7.3.30.0040.00814.96
7.3.20.0100.00316.83
7.3.10.0040.01116.79
7.3.00.0030.00816.71
7.2.330.0030.01516.82
7.2.320.0060.01316.49
7.2.310.0130.01016.68
7.2.300.0080.00816.68
7.2.290.0090.00916.76
7.2.250.0100.01015.15
7.2.240.0070.01414.99
7.2.230.0040.01115.01
7.2.220.0110.00715.20
7.2.210.0080.00815.18
7.2.200.0070.00715.03
7.2.190.0090.00315.08
7.2.180.0060.00915.37
7.2.170.0030.00914.92
7.2.130.0000.01316.98
7.2.120.0030.01016.74
7.2.110.0030.00916.90
7.2.100.0050.00516.91
7.2.90.0030.00917.05
7.2.80.0030.01316.99
7.2.70.0080.00017.04
7.2.60.0070.00717.00
7.2.50.0030.01017.13
7.2.40.0080.00317.08
7.2.30.0040.01116.80
7.2.20.0000.00816.82
7.2.10.0000.01317.03
7.2.00.0040.00716.91
7.1.330.0060.00615.84
7.1.320.0060.01216.19
7.1.310.0040.00816.02
7.1.300.0100.00315.86
7.1.290.0000.01615.91
7.1.280.0090.00615.66
7.1.270.0030.01015.54
7.1.260.0100.00315.82
7.1.250.0030.00615.69
7.1.70.0030.00617.50
7.1.60.0120.00919.40
7.1.50.0070.01716.79
7.1.00.0130.06722.38
7.0.200.0000.00816.95
7.0.140.0070.07021.95
7.0.60.0070.07021.73
7.0.50.0070.06722.05
7.0.40.0030.08720.04
7.0.30.0030.08320.08
7.0.20.0070.08320.12
7.0.10.0070.06020.10
7.0.00.0030.08720.07
5.6.280.0070.07021.02
5.6.210.0000.08020.47
5.6.200.0030.08021.01
5.6.190.0000.08021.13
5.6.180.0030.08321.04
5.6.170.0030.07721.00
5.6.160.0070.07021.15
5.6.150.0070.08021.02
5.6.140.0030.08020.96
5.6.130.0100.06321.02
5.6.120.0000.08720.99
5.6.110.0100.06720.98
5.6.100.0030.08721.00
5.6.90.0170.07021.09
5.6.80.0030.08320.48
5.6.70.0100.06020.36
5.6.60.0100.07020.27
5.6.50.0100.06720.43
5.6.40.0070.08020.25
5.6.30.0100.07320.34
5.6.20.0000.07020.33
5.6.10.0000.04020.37
5.6.00.0000.08720.36
5.5.350.0100.08020.33
5.5.340.0000.05320.88
5.5.330.0130.06720.96
5.5.320.0030.08320.73
5.5.310.0030.08720.86
5.5.300.0070.04720.96
5.5.290.0000.08020.64
5.5.280.0070.04320.88
5.5.270.0030.08020.72
5.5.260.0070.08320.89
5.5.250.0070.07020.54
5.5.240.0030.08320.16
5.5.230.0100.05720.14
5.5.220.0000.08320.25
5.5.210.0070.06320.25
5.5.200.0030.08020.30
5.5.190.0000.05720.09
5.5.180.0030.08020.21
5.5.160.0070.05020.00
5.5.150.0070.06320.14
5.5.140.0030.05720.03
5.5.130.0000.07720.32
5.5.120.0000.06720.29
5.5.110.0030.07020.02
5.5.100.0000.08320.01
5.5.90.0100.05020.12
5.5.80.0000.06320.07
5.5.70.0070.06720.07
5.5.60.0070.07320.08
5.5.50.0000.07719.88
5.5.40.0030.07720.19
5.5.30.0100.07019.96
5.5.20.0070.07320.11
5.5.10.0100.04020.18
5.5.00.0070.07320.04
5.4.450.0130.07019.38
5.4.440.0170.07019.43
5.4.430.0030.06319.24
5.4.420.0030.08319.39
5.4.410.0000.06019.25
5.4.400.0100.06719.06
5.4.390.0000.05019.02
5.4.380.0000.08019.05
5.4.370.0030.07019.11
5.4.360.0030.07018.98
5.4.350.0030.06719.17
5.4.340.0000.09719.20
5.4.320.0000.08319.01
5.4.310.0070.07318.99
5.4.300.0070.06719.20
5.4.290.0070.06319.01
5.4.280.0100.07319.00
5.4.270.0030.07718.96
5.4.260.0030.07719.00
5.4.250.0000.08018.84
5.4.240.0030.06318.98
5.4.230.0030.06019.10
5.4.220.0030.07719.00
5.4.210.0130.06718.99
5.4.200.0070.07319.16
5.4.190.0070.06718.98
5.4.180.0030.04718.99
5.4.170.0070.07319.06
5.4.160.0000.07318.98
5.4.150.0000.08318.98
5.4.140.0070.07316.32
5.4.130.0070.07316.01
5.4.120.0070.06716.33
5.4.110.0070.06716.25
5.4.100.0070.06016.21
5.4.90.0030.06716.28
5.4.80.0070.04716.20
5.4.70.0000.03716.36
5.4.60.0000.07716.28
5.4.50.0000.07716.47
5.4.40.0030.06716.25
5.4.30.0000.06716.45
5.4.20.0100.06316.41
5.4.10.0030.07716.38
5.4.00.0030.05715.66
5.3.290.0030.06714.59
5.3.280.0000.07014.52
5.3.270.0030.08014.54
5.3.260.0130.06714.45
5.3.250.0000.08014.52
5.3.240.0030.07314.55
5.3.230.0030.07014.58
5.3.220.0000.07014.55
5.3.210.0030.07714.52
5.3.200.0070.06714.54
5.3.190.0030.06314.55
5.3.180.0000.08314.47
5.3.170.0000.04014.51
5.3.160.0000.08014.40
5.3.150.0030.07314.46
5.3.140.0100.05714.50
5.3.130.0070.07014.47
5.3.120.0070.06714.46
5.3.110.0000.05314.45
5.3.100.0000.07013.98
5.3.90.0000.07313.94
5.3.80.0000.05013.86
5.3.70.0070.06013.91
5.3.60.0000.07313.98
5.3.50.0000.06313.79
5.3.40.0000.07313.92
5.3.30.0070.06313.75
5.3.20.0030.03313.45
5.3.10.0100.05713.55
5.3.00.0030.06313.61
5.2.170.0000.04311.17
5.2.160.0030.06010.93
5.2.150.0070.06011.15
5.2.140.0030.05011.12
5.2.130.0070.03011.10
5.2.120.0000.06011.09
5.2.110.0030.06311.13
5.2.100.0070.06011.14
5.2.90.0030.06010.89
5.2.80.0000.06011.09
5.2.70.0000.05010.92
5.2.60.0070.06010.86
5.2.50.0000.06711.00
5.2.40.0030.04010.91
5.2.30.0030.05710.89
5.2.20.0000.04310.95
5.2.10.0030.04310.70
5.2.00.0000.05310.56
5.1.60.0000.0279.96
5.1.50.0000.02310.02
5.1.40.0000.0239.96
5.1.30.0030.02310.38
5.1.20.0030.02710.36
5.1.10.0000.03010.10
5.1.00.0000.02710.09
5.0.50.0000.0208.53
5.0.40.0030.0178.49
5.0.30.0030.0238.49
5.0.20.0000.0478.49
5.0.10.0030.0208.49
5.0.00.0000.0338.49
4.4.90.0030.0278.49
4.4.80.0000.0308.49
4.4.70.0000.0408.49
4.4.60.0030.0308.49
4.4.50.0030.0338.49
4.4.40.0030.0238.49
4.4.30.0000.0178.49
4.4.20.0000.0138.49
4.4.10.0000.0178.49
4.4.00.0000.0238.49
4.3.110.0000.0178.49
4.3.100.0000.0138.49
4.3.90.0000.0138.49
4.3.80.0000.0238.49
4.3.70.0000.0178.49
4.3.60.0000.0208.49
4.3.50.0000.0238.49
4.3.40.0000.0278.49
4.3.30.0000.0138.49
4.3.20.0070.0108.49
4.3.10.0030.0108.49
4.3.00.0000.0178.49

preferences:
46.98 ms | 401 KiB | 5 Q