3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = "\xC2°Freen\x18 ew°\x90ɮ\x7F"; //$result="a\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.0030.01316.63
8.3.50.0160.00521.27
8.3.40.0130.00319.02
8.3.30.0030.01218.84
8.3.20.0040.00418.90
8.3.10.0080.00020.84
8.3.00.0040.00421.77
8.2.180.0110.00716.38
8.2.170.0110.00422.96
8.2.160.0030.01020.53
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0000.00826.16
8.2.120.0090.00019.61
8.2.110.0030.00622.37
8.2.100.0080.00417.91
8.2.90.0080.00019.05
8.2.80.0040.00417.97
8.2.70.0000.00917.75
8.2.60.0030.00517.93
8.2.50.0080.00018.07
8.2.40.0040.00417.95
8.2.30.0040.00419.94
8.2.20.0030.00617.80
8.2.10.0000.00819.71
8.2.00.0060.00317.90
8.1.280.0070.01025.92
8.1.270.0080.00023.99
8.1.260.0060.01326.35
8.1.250.0050.00328.09
8.1.240.0040.00422.61
8.1.230.0040.00820.97
8.1.220.0030.00618.77
8.1.210.0040.00419.10
8.1.200.0030.00617.23
8.1.190.0040.00417.40
8.1.180.0040.00418.10
8.1.170.0030.00618.79
8.1.160.0040.00418.91
8.1.150.0000.00718.71
8.1.140.0040.00417.54
8.1.130.0000.00717.86
8.1.120.0000.00717.58
8.1.110.0040.00417.57
8.1.100.0000.00817.60
8.1.90.0040.00417.51
8.1.80.0040.00417.48
8.1.70.0030.00317.56
8.1.60.0070.00317.75
8.1.50.0000.00817.66
8.1.40.0030.00617.53
8.1.30.0020.00517.66
8.1.20.0000.00817.82
8.1.10.0040.00417.55
8.1.00.0040.00417.63
8.0.300.0040.00420.02
8.0.290.0030.00716.75
8.0.280.0000.00718.46
8.0.270.0070.00017.20
8.0.260.0000.00617.02
8.0.250.0070.00017.07
8.0.240.0110.00017.17
8.0.230.0040.00417.06
8.0.220.0030.00316.88
8.0.210.0040.00416.93
8.0.200.0030.00317.07
8.0.190.0060.00317.07
8.0.180.0000.00716.90
8.0.170.0040.00416.90
8.0.160.0000.00717.09
8.0.150.0000.00816.85
8.0.140.0030.00516.95
8.0.130.0030.00613.42
8.0.120.0040.00416.96
8.0.110.0000.00716.84
8.0.100.0040.00416.77
8.0.90.0070.00016.90
8.0.80.0040.01117.00
8.0.70.0050.00316.85
8.0.60.0040.00417.00
8.0.50.0050.00216.92
8.0.30.0130.00817.18
8.0.20.0090.00917.40
8.0.10.0000.00717.23
8.0.00.0100.00817.01
7.4.330.0000.00615.11
7.4.320.0040.00416.86
7.4.300.0060.00016.75
7.4.290.0040.00416.82
7.4.280.0000.00716.73
7.4.270.0050.00516.78
7.4.260.0030.00313.42
7.4.250.0000.00716.75
7.4.240.0030.00316.75
7.4.230.0000.00716.93
7.4.220.0100.00616.68
7.4.210.0040.01316.79
7.4.200.0040.00416.64
7.4.190.0070.00016.69
7.4.160.0060.01016.56
7.4.150.0120.00617.40
7.4.140.0100.01017.86
7.4.130.0070.01016.56
7.4.120.0110.00616.62
7.4.110.0060.01416.53
7.4.100.0100.00816.67
7.4.90.0140.00316.74
7.4.80.0060.01219.37
7.4.70.0030.01416.49
7.4.60.0090.01016.65
7.4.50.0040.00416.57
7.4.40.0110.00222.27
7.4.30.0090.00916.79
7.4.00.0060.00615.19
7.3.330.0000.00513.09
7.3.320.0060.00013.16
7.3.310.0030.00316.28
7.3.300.0050.00316.33
7.3.290.0090.00616.38
7.3.280.0100.00416.32
7.3.270.0070.01017.40
7.3.260.0050.01218.24
7.3.250.0110.00916.54
7.3.240.0100.00716.35
7.3.230.0200.00016.55
7.3.210.0070.01316.36
7.3.200.0070.01119.39
7.3.190.0090.01516.45
7.3.180.0040.01216.33
7.3.170.0060.01516.36
7.3.160.0000.01516.38
7.3.120.0000.01615.17
7.3.10.0090.00316.71
7.3.00.0080.00016.86
7.2.330.0030.01416.55
7.2.320.0030.01416.49
7.2.310.0060.01216.56
7.2.300.0110.00616.82
7.2.290.0060.01216.73
7.2.130.0040.00817.02
7.2.120.0090.00316.98
7.2.110.0110.00316.85
7.2.100.0070.00416.96
7.2.90.0060.00917.10
7.2.80.0030.00916.99
7.2.70.0070.00717.11
7.2.60.0070.00717.19
7.2.50.0030.00517.13
7.2.40.0050.00517.24
7.2.30.0040.00817.03
7.2.20.0000.01117.21
7.2.10.0000.01217.16
7.2.00.0020.01418.00
7.1.250.0000.01316.05
7.1.200.0100.00315.87
7.1.100.0070.00718.43
7.1.70.0030.00617.43
7.1.60.0100.01319.40
7.1.50.0000.01416.85
7.1.00.0030.03722.33
7.0.200.0030.00616.88
7.0.140.0100.06722.09
7.0.60.0000.03321.79
7.0.50.0000.04722.12
7.0.40.0130.07020.11
7.0.30.0100.03720.19
7.0.20.0070.04320.14
7.0.10.0130.06320.02
7.0.00.0000.04319.95
5.6.280.0070.06721.11
5.6.210.0000.03320.51
5.6.200.0070.08020.99
5.6.190.0030.04021.12
5.6.180.0030.03720.99
5.6.170.0070.04021.10
5.6.160.0070.04720.98
5.6.150.0030.03720.98
5.6.140.0000.04720.89
5.6.130.0030.05020.91
5.6.120.0000.04720.98
5.6.110.0030.04021.01
5.6.100.0070.05021.11
5.6.90.0070.03721.08
5.6.80.0070.03720.53
5.6.70.0030.05320.34
5.6.60.0000.06020.33
5.6.50.0030.05720.40
5.6.40.0030.04020.22
5.6.30.0130.03720.37
5.6.20.0230.06720.43
5.6.10.0200.02720.37
5.6.00.0130.08020.42
5.5.350.0000.03320.30
5.5.340.0000.05720.73
5.5.330.0130.04720.72
5.5.320.0070.04020.77
5.5.310.0030.04020.87
5.5.300.0030.04020.90
5.5.290.0030.07020.88
5.5.280.0070.06720.89
5.5.270.0000.04320.86
5.5.260.0000.06020.76
5.5.250.0000.08020.59
5.5.240.0030.03720.26
5.5.230.0030.03720.14
5.5.220.0030.05720.06
5.5.210.0070.08320.06
5.5.200.0000.04020.09
5.5.190.0170.07020.25
5.5.180.0130.06020.22
5.5.160.0100.04320.30
5.5.150.0070.07020.16
5.5.140.0000.04720.15
5.5.130.0100.06020.19
5.5.120.0070.03720.03
5.5.110.0030.04020.14
5.5.100.0030.04020.05
5.5.90.0070.07020.13
5.5.80.0100.03720.11
5.5.70.0200.03320.07
5.5.60.0100.03320.10
5.5.50.0130.04020.00
5.5.40.0130.03720.00
5.5.30.0130.04319.99
5.5.20.0070.04020.09
5.5.10.0100.07719.99
5.5.00.0030.04720.00
5.4.450.0000.04019.52
5.4.440.0130.05019.40
5.4.430.0070.07319.48
5.4.420.0000.04319.48
5.4.410.0000.03719.35
5.4.400.0000.03719.20
5.4.390.0000.03718.95
5.4.380.0030.03718.85
5.4.370.0000.04719.16
5.4.360.0070.03319.02
5.4.350.0000.04319.08
5.4.340.0170.03019.18
5.4.320.0030.03319.06
5.4.310.0100.07718.97
5.4.300.0030.05318.84
5.4.290.0000.08018.93
5.4.280.0030.04318.85
5.4.270.0130.04718.92
5.4.260.0100.03018.97
5.4.250.0130.06319.00
5.4.240.0170.04319.09
5.4.230.0130.03018.94
5.4.220.0200.07018.98
5.4.210.0070.04719.00
5.4.200.0200.04718.96
5.4.190.0130.07319.00
5.4.180.0100.03718.85
5.4.170.0070.04318.91
5.4.160.0070.04319.01
5.4.150.0000.03719.07
5.4.140.0000.03716.21
5.4.130.0100.06716.13
5.4.120.0130.05316.20
5.4.110.0170.03016.36
5.4.100.0100.04016.21
5.4.90.0030.03716.38
5.4.80.0100.03016.46
5.4.70.0070.08016.38
5.4.60.0100.04716.30
5.4.50.0070.07016.19
5.4.40.0170.03016.27
5.4.30.0130.06016.15
5.4.20.0030.04316.32
5.4.10.0170.06716.18
5.4.00.0100.04015.80
5.3.290.0130.06014.64
5.3.280.0070.03714.49
5.3.270.0000.04014.58
5.3.260.0100.03014.52
5.3.250.0000.04014.43
5.3.240.0070.05314.45
5.3.230.0030.08314.51
5.3.220.0130.05014.35
5.3.210.0070.04314.39
5.3.200.0070.07314.39
5.3.190.0100.03314.54
5.3.180.0030.03714.50
5.3.170.0030.03714.50
5.3.160.0070.06714.55
5.3.150.0100.03714.48
5.3.140.0070.08014.47
5.3.130.0100.07314.49
5.3.120.0070.06714.47
5.3.110.0130.03714.48
5.3.100.0070.03713.82
5.3.90.0270.04013.95
5.3.80.0100.03713.86
5.3.70.0070.03713.78
5.3.60.0030.03713.97
5.3.50.0070.02713.80
5.3.40.0100.02313.88
5.3.30.0100.05713.88
5.3.20.0100.03313.61
5.3.10.0070.06013.60
5.3.00.0070.03313.56
5.2.170.0030.02711.14
5.2.160.0030.04710.97
5.2.150.0000.02311.12
5.2.140.0030.04711.13
5.2.130.0000.03311.12
5.2.120.0030.05010.92
5.2.110.0030.04010.93
5.2.100.0000.05310.88
5.2.90.0000.05310.90
5.2.80.0030.03711.07
5.2.70.0030.04311.08
5.2.60.0000.05711.05
5.2.50.0070.03710.81
5.2.40.0000.03711.00
5.2.30.0030.04011.00
5.2.20.0000.06010.95
5.2.10.0070.05010.86
5.2.00.0000.06010.78
5.1.60.0030.02310.05
5.1.50.0000.03710.00
5.1.40.0000.0239.80
5.1.30.0030.02310.18
5.1.20.0000.03010.30
5.1.10.0000.0239.96
5.1.00.0000.03010.04
5.0.50.0000.0338.98
5.0.40.0000.0278.98
5.0.30.0030.0578.98
5.0.20.0000.0308.98
5.0.10.0000.0478.98
5.0.00.0000.0638.98
4.4.90.0030.0208.98
4.4.80.0030.0308.98
4.4.70.0000.0178.98
4.4.60.0000.0178.98
4.4.50.0030.0338.98
4.4.40.0000.0238.98
4.4.30.0000.0278.98
4.4.20.0000.0208.98
4.4.10.0070.0178.98
4.4.00.0000.0378.98
4.3.110.0070.0278.98
4.3.100.0000.0238.98
4.3.90.0000.0178.98
4.3.80.0000.0438.98
4.3.70.0030.0178.98
4.3.60.0000.0308.98
4.3.50.0000.0338.98
4.3.40.0030.0378.98
4.3.30.0000.0178.98
4.3.20.0030.0208.98
4.3.10.0000.0178.98
4.3.00.0000.0378.98

preferences:
42.84 ms | 401 KiB | 5 Q