3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = "°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}\xC2]~i', '', $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.0070.01116.50
8.3.50.0090.01117.61
8.3.40.0090.00618.92
8.3.30.0070.00718.97
8.3.20.0000.00818.73
8.3.10.0080.00020.61
8.3.00.0050.00319.38
8.2.180.0150.00417.00
8.2.170.0060.00922.96
8.2.160.0110.00321.36
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0060.00319.50
8.2.110.0060.01221.09
8.2.100.0090.00317.91
8.2.90.0030.00719.40
8.2.80.0060.00317.93
8.2.70.0030.00617.61
8.2.60.0090.00017.93
8.2.50.0000.00818.07
8.2.40.0080.00018.28
8.2.30.0040.00717.98
8.2.20.0040.00417.74
8.2.10.0000.00717.98
8.2.00.0060.00317.88
8.1.280.0070.01125.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0090.00020.69
8.1.230.0040.00821.04
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0030.00617.36
8.1.190.0040.00417.39
8.1.180.0040.00418.10
8.1.170.0000.00818.96
8.1.160.0040.00418.84
8.1.150.0000.00718.84
8.1.140.0080.00017.52
8.1.130.0030.00317.82
8.1.120.0060.00317.52
8.1.110.0050.00317.52
8.1.100.0000.00717.50
8.1.90.0050.00317.58
8.1.80.0000.00717.60
8.1.70.0080.00017.56
8.1.60.0040.00417.74
8.1.50.0040.00417.60
8.1.40.0030.00617.70
8.1.30.0000.00817.76
8.1.20.0060.00317.82
8.1.10.0040.00417.59
8.1.00.0080.00017.54
8.0.300.0040.00419.81
8.0.290.0070.00016.75
8.0.280.0000.00718.48
8.0.270.0070.00017.32
8.0.260.0070.00017.07
8.0.250.0000.00717.04
8.0.240.0000.01017.07
8.0.230.0000.00717.05
8.0.220.0070.00017.05
8.0.210.0030.00316.98
8.0.200.0030.00317.04
8.0.190.0030.00617.02
8.0.180.0040.00417.07
8.0.170.0040.00416.88
8.0.160.0020.00516.98
8.0.150.0060.00316.82
8.0.140.0050.00316.99
8.0.130.0060.00013.40
8.0.120.0040.00416.88
8.0.110.0040.00416.88
8.0.100.0020.00516.89
8.0.90.0040.00416.95
8.0.80.0080.00916.96
8.0.70.0040.00417.05
8.0.60.0020.00517.05
8.0.50.0040.00416.86
8.0.30.0130.00617.36
8.0.20.0150.00417.17
8.0.10.0040.00417.19
8.0.00.0100.00917.08
7.4.330.0020.00213.20
7.4.320.0000.00616.82
7.4.300.0030.00316.63
7.4.290.0000.00716.72
7.4.280.0030.00616.84
7.4.270.0030.00316.66
7.4.260.0000.00513.61
7.4.250.0050.00316.75
7.4.240.0040.00416.66
7.4.230.0070.00016.92
7.4.220.0070.01316.82
7.4.210.0080.00616.83
7.4.200.0030.00316.82
7.4.190.0030.00416.63
7.4.160.0030.01416.77
7.4.150.0190.00416.72
7.4.140.0110.00716.66
7.4.130.0080.01316.61
7.4.120.0120.00616.84
7.4.110.0040.02016.53
7.4.100.0060.01216.71
7.4.90.0060.01116.86
7.4.80.0090.00916.69
7.4.70.0060.01816.45
7.4.60.0100.00816.80
7.4.50.0060.00316.78
7.4.40.0030.00816.61
7.4.30.0060.01216.72
7.4.00.0080.00715.08
7.3.330.0030.00313.08
7.3.320.0050.00013.11
7.3.310.0040.00416.30
7.3.300.0090.00016.38
7.3.290.0070.00716.41
7.3.280.0070.00816.34
7.3.270.0070.01016.66
7.3.260.0100.00916.55
7.3.250.0120.00916.63
7.3.240.0120.00616.41
7.3.230.0100.00716.45
7.3.210.0140.00416.26
7.3.200.0090.01219.39
7.3.190.0110.00716.40
7.3.180.0060.01016.52
7.3.170.0060.01016.61
7.3.160.0100.00616.57
7.3.120.0070.00814.94
7.3.110.0100.01014.95
7.3.100.0070.00714.96
7.3.90.0030.00614.96
7.3.80.0040.01214.79
7.3.70.0100.00014.86
7.3.60.0030.01214.71
7.3.50.0030.00614.79
7.3.40.0110.00414.97
7.3.30.0070.00714.96
7.3.20.0040.01116.79
7.3.10.0100.00316.61
7.3.00.0100.00716.59
7.2.330.0090.00916.58
7.2.320.0120.00916.81
7.2.310.0110.00616.73
7.2.300.0170.00616.74
7.2.290.0070.01016.67
7.2.250.0100.01015.21
7.2.240.0130.00315.13
7.2.230.0000.01715.34
7.2.220.0110.00415.05
7.2.210.0040.01415.14
7.2.200.0100.00615.14
7.2.190.0030.00915.21
7.2.180.0040.00815.10
7.2.170.0060.00914.96
7.2.00.0070.01019.68
7.1.330.0080.00616.09
7.1.320.0030.01316.18
7.1.310.0000.01615.47
7.1.300.0090.00915.98
7.1.290.0070.01015.88
7.1.280.0000.01516.05
7.1.270.0060.01015.96
7.1.260.0090.00315.83
7.1.100.0070.00718.01
7.1.70.0040.00417.26
7.1.60.0070.01019.40
7.1.50.0030.01917.25
7.1.00.0100.06322.38
7.0.200.0180.00014.93
7.0.140.0000.08022.07
7.0.120.0000.07022.09
7.0.60.0030.04319.94
7.0.50.0070.08017.91
7.0.40.0130.07320.11
7.0.30.0530.07320.11
7.0.20.0270.07720.19
7.0.10.0070.06320.23
7.0.00.0030.05020.14
5.6.280.0000.07721.09
5.6.210.0030.08720.56
5.6.200.0000.04318.12
5.6.190.0030.04320.56
5.6.180.0200.04720.60
5.6.170.0230.07020.50
5.6.160.0030.05020.61
5.6.150.0030.08318.16
5.6.140.0000.04318.13
5.6.130.0200.07018.23
5.6.120.0100.07720.95
5.6.110.0030.09321.13
5.6.100.0070.05321.04
5.6.90.0070.08321.12
5.6.80.0200.06720.40
5.5.350.0070.06720.45
5.5.340.0070.08317.96
5.5.330.0070.04320.37
5.5.320.0330.06320.24
5.5.310.0200.03720.29
5.5.300.0070.05317.96
5.5.290.0130.07317.95
5.5.280.0030.08720.80
5.5.270.0030.07320.76
5.5.260.0000.08720.84
5.5.250.0130.06320.55
5.5.240.0370.07020.19
5.4.450.0030.04319.48
5.4.440.0030.05319.25
5.4.430.0030.08319.11
5.4.420.0100.07019.14
5.4.410.0070.07719.00
5.4.400.0070.06019.18
5.4.390.0170.06719.16
5.4.380.0070.04319.08
5.4.370.0070.04018.91
5.4.360.0100.07718.80
5.4.350.0100.03718.79
5.4.340.0030.04718.79
5.4.320.0130.04019.15
5.4.310.0070.06319.18
5.4.300.0030.07319.14
5.4.290.0070.08319.15
5.4.280.0070.08019.14
5.4.270.0030.05319.07
5.4.260.0100.07018.91
5.4.250.0070.06718.80
5.4.240.0070.07018.78
5.4.230.0000.05018.91
5.4.220.0030.05018.80
5.4.210.0100.04018.78
5.4.200.0100.04019.07
5.4.190.0030.05019.16
5.4.180.0030.05018.91
5.4.170.0070.03718.88
5.4.160.0030.08019.13
5.4.150.0070.05318.99
5.4.140.0000.05016.43
5.4.130.0000.05716.19
5.4.120.0070.03316.34
5.4.110.0170.06316.37
5.4.100.0030.07316.32
5.4.90.0070.07016.27
5.4.80.0130.05016.25
5.4.70.0030.07316.34
5.4.60.0000.07316.32
5.4.50.0070.07016.28
5.4.40.0000.05016.21
5.4.30.0070.07316.38
5.4.20.0030.06716.21
5.4.10.0130.06716.32
5.4.00.0130.03015.66
5.3.290.0070.05014.45
5.3.280.0000.08014.47
5.3.270.0170.06314.55
5.3.260.0070.04314.54
5.3.250.0070.07314.48
5.3.240.0070.04714.53
5.3.230.0070.08014.55
5.3.220.0130.04714.50
5.3.210.0100.07314.50
5.3.200.0030.07014.51
5.3.190.0100.03714.66
5.3.180.0100.07314.46
5.3.170.0100.07314.51
5.3.160.0070.05714.49
5.3.150.0030.06714.50
5.3.140.0070.07714.49
5.3.130.0130.06014.51
5.3.120.0000.04714.56
5.3.110.0030.06014.50
5.3.100.0070.03313.85
5.3.90.0070.07713.82
5.3.80.0070.04713.95
5.3.70.0070.07313.95
5.3.60.0100.06013.95
5.3.50.0170.05713.89
5.3.40.0030.04713.89
5.3.30.0070.05713.89
5.3.20.0030.07713.48
5.3.10.0030.06013.47
5.3.00.0070.04313.56
5.2.170.0000.04011.08
5.2.160.0030.03311.08
5.2.150.0030.06711.05
5.2.140.0000.03311.00
5.2.130.0030.03711.09
5.2.120.0100.03010.98
5.2.110.0070.06011.27
5.2.100.0070.05011.25
5.2.90.0030.05011.19
5.2.80.0070.03011.18
5.2.70.0000.03710.99
5.2.60.0100.06010.93
5.2.50.0130.02710.98
5.2.40.0000.03711.08
5.2.30.0030.03010.91
5.2.20.0070.02710.96
5.2.10.0070.03710.74
5.2.00.0000.04310.60
5.1.60.0030.02710.01
5.1.50.0000.06010.05
5.1.40.0070.03710.02
5.1.30.0100.04310.33
5.1.20.0030.06010.34
5.1.10.0070.05310.06
5.1.00.0070.05310.08
5.0.50.0000.0238.56
5.0.40.0100.0378.56
5.0.30.0000.0678.56
5.0.20.0070.0278.56
5.0.10.0070.0378.56
5.0.00.0070.0378.56
4.4.90.0000.0438.56
4.4.80.0030.0138.56
4.4.70.0070.0138.56
4.4.60.0030.0338.56
4.4.50.0000.0238.56
4.4.40.0000.0308.56
4.4.30.0030.0308.56
4.4.20.0030.0278.56
4.4.10.0070.0238.56
4.4.00.0070.0408.56
4.3.110.0030.0138.56
4.3.100.0000.0378.56
4.3.90.0030.0338.56
4.3.80.0000.0338.56
4.3.70.0000.0408.56
4.3.60.0030.0238.56
4.3.50.0000.0238.56
4.3.40.0000.0538.56
4.3.30.0000.0278.56
4.3.20.0030.0278.56
4.3.10.0000.0238.56
4.3.00.0000.0378.56

preferences:
39.69 ms | 401 KiB | 5 Q