3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = "°Freen\x18 ew°\x90ɮ\x7F\xc2"; //$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.40.0180.00318.80
8.3.30.0140.00418.88
8.3.20.0030.00618.81
8.3.10.0050.00320.65
8.3.00.0040.00417.88
8.2.170.0000.01422.96
8.2.160.0030.01022.38
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0080.00019.95
8.2.110.0030.00721.25
8.2.100.0050.00517.91
8.2.90.0080.00019.27
8.2.80.0060.00318.04
8.2.70.0030.00617.88
8.2.60.0000.00817.80
8.2.50.0040.00418.07
8.2.40.0040.00418.34
8.2.30.0040.00417.96
8.2.20.0040.00417.70
8.2.10.0040.00417.86
8.2.00.0080.00017.97
8.1.270.0090.00024.66
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0060.00320.80
8.1.230.0040.00820.89
8.1.220.0080.00017.79
8.1.210.0040.00418.90
8.1.200.0030.00617.38
8.1.190.0000.00817.39
8.1.180.0000.01018.10
8.1.170.0040.00418.89
8.1.160.0000.00718.94
8.1.150.0000.00818.77
8.1.140.0030.00517.60
8.1.130.0030.00317.88
8.1.120.0040.00417.68
8.1.110.0040.00417.65
8.1.100.0000.00717.52
8.1.90.0030.00517.65
8.1.80.0080.00017.66
8.1.70.0000.00717.51
8.1.60.0030.00617.75
8.1.50.0080.00017.68
8.1.40.0000.00817.56
8.1.30.0000.00717.79
8.1.20.0050.00317.74
8.1.10.0040.00417.63
8.1.00.0000.00817.59
8.0.300.0030.00919.76
8.0.290.0000.00716.88
8.0.280.0040.00418.39
8.0.270.0050.00317.29
8.0.260.0030.00316.98
8.0.250.0000.00817.01
8.0.240.0070.00317.12
8.0.230.0000.00716.96
8.0.220.0000.00716.96
8.0.210.0030.00316.93
8.0.200.0060.00317.09
8.0.190.0000.00917.05
8.0.180.0000.00717.00
8.0.170.0030.00617.03
8.0.160.0040.00417.04
8.0.150.0050.00316.91
8.0.140.0060.00317.00
8.0.130.0060.00313.34
8.0.120.0040.00416.95
8.0.110.0040.00416.95
8.0.100.0080.00016.95
8.0.90.0080.00016.98
8.0.80.0130.00317.01
8.0.70.0040.00416.98
8.0.60.0020.00517.09
8.0.50.0000.00716.92
8.0.30.0100.01017.41
8.0.20.0130.00817.07
8.0.10.0000.00817.13
8.0.00.0100.00917.06
7.4.330.0030.00313.24
7.4.320.0030.00316.88
7.4.300.0060.00016.82
7.4.290.0040.00416.83
7.4.280.0030.00616.82
7.4.270.0030.00516.68
7.4.260.0030.00313.48
7.4.250.0050.00316.70
7.4.240.0000.00816.65
7.4.230.0030.00316.85
7.4.220.0000.02216.76
7.4.210.0050.01016.78
7.4.200.0040.00416.61
7.4.190.0080.00016.62
7.4.160.0130.00716.91
7.4.150.0150.00616.88
7.4.140.0120.00516.64
7.4.130.0110.00916.73
7.4.120.0080.00916.50
7.4.110.0070.01016.71
7.4.100.0080.00817.03
7.4.90.0040.01316.57
7.4.80.0090.00916.69
7.4.70.0040.01416.53
7.4.60.0070.01016.95
7.4.50.0000.00816.65
7.4.40.0110.00416.69
7.4.30.0070.01016.81
7.4.00.0060.00914.91
7.3.330.0060.00013.11
7.3.320.0000.00613.26
7.3.310.0000.00816.44
7.3.300.0070.00016.27
7.3.290.0090.00616.35
7.3.280.0090.00816.39
7.3.270.0150.00816.58
7.3.260.0050.01716.42
7.3.250.0150.00616.40
7.3.240.0150.00416.45
7.3.230.0070.01016.68
7.3.210.0120.00616.61
7.3.200.0130.00919.39
7.3.190.0120.00916.33
7.3.180.0000.01616.48
7.3.170.0160.00316.57
7.3.160.0090.00816.76
7.3.120.0030.01314.96
7.3.10.0030.01416.63
7.3.00.0100.01016.41
7.2.330.0060.01216.75
7.2.320.0090.00916.61
7.2.310.0110.00716.78
7.2.300.0070.01116.66
7.2.290.0080.00816.77
7.2.130.0060.00916.69
7.2.120.0090.00916.50
7.2.110.0000.01816.82
7.2.100.0090.01217.09
7.2.90.0300.00416.93
7.2.80.0070.00816.90
7.2.70.0340.01016.68
7.2.60.0160.01316.84
7.2.50.0290.00716.85
7.2.40.0200.01016.89
7.2.30.0340.01016.73
7.2.20.0170.00316.71
7.2.10.0070.01016.82
7.2.00.0090.00818.44
7.1.250.0120.00415.93
7.1.200.0040.00415.96
7.1.100.0070.00418.39
7.1.70.0040.00417.54
7.1.60.0110.01519.40
7.1.50.0100.01016.86
7.1.00.0100.07022.36
7.0.200.0050.00316.68
7.0.140.0070.06721.99
7.0.120.0070.07322.08
7.0.60.0030.04019.93
7.0.50.0070.07017.84
7.0.40.0070.04020.07
7.0.30.0270.07320.20
7.0.20.0370.07020.02
7.0.10.0170.04020.03
7.0.00.0030.04320.32
5.6.280.0100.06321.09
5.6.210.0070.08720.47
5.6.200.0030.05318.23
5.6.190.0070.06320.55
5.6.180.0330.07020.27
5.6.170.0200.04720.55
5.6.160.0200.05320.54
5.6.150.0070.08018.17
5.6.140.0030.04718.12
5.6.130.0130.08018.21
5.6.120.0000.05021.05
5.6.110.0130.08020.98
5.6.100.0000.08720.95
5.6.90.0170.08020.94
5.6.80.0030.08320.36
5.6.70.4100.04020.41
5.5.350.0270.07720.36
5.5.340.0170.04317.98
5.5.330.0000.05020.23
5.5.320.0130.04320.19
5.5.310.0200.06320.41
5.5.300.0130.05017.95
5.5.290.0100.04317.98
5.5.280.0030.04020.77
5.5.270.0070.07320.76
5.5.260.0030.08320.79
5.5.250.0030.06320.61
5.5.240.0000.04020.32
5.4.450.0070.03719.24
5.4.440.0000.04019.41
5.4.430.0000.04019.24
5.4.420.0030.04019.41
5.4.410.0030.04319.35
5.4.400.0030.03719.05
5.4.390.0030.03719.08
5.4.380.0030.03719.07
5.4.370.0070.06719.20
5.4.360.0030.03719.11
5.4.350.0000.04019.09
5.4.340.0100.07018.92
5.4.320.0130.06019.18
5.4.310.0070.04718.96
5.4.300.0100.05318.80
5.4.290.0070.08319.19
5.4.280.0200.03719.18
5.4.270.0030.08319.13
5.4.260.0130.04018.79
5.4.250.0030.03719.07
5.4.240.0130.07018.96
5.4.230.0030.05719.13
5.4.220.0000.04718.79
5.4.210.0070.07018.91
5.4.200.0070.04019.17
5.4.190.0070.04319.07
5.4.180.0070.03719.07
5.4.170.0030.08719.16
5.4.160.0030.05019.06
5.4.150.0000.04718.88
5.4.140.0070.05716.38
5.4.130.0030.04016.36
5.4.120.0000.05016.19
5.4.110.0130.03716.28
5.4.100.0070.06016.34
5.4.90.0100.07016.60
5.4.80.0070.07016.13
5.4.70.0130.06716.26
5.4.60.0130.05316.28
5.4.50.0070.07016.31
5.4.40.0000.04716.34
5.4.30.0030.06016.25
5.4.20.0100.06716.25
5.4.10.0100.06316.25
5.4.00.0030.04315.61
5.3.290.0130.06714.64
5.3.280.0030.04314.55
5.3.270.0030.04714.59
5.3.260.0100.07014.53
5.3.250.0030.05014.55
5.3.240.0070.05314.40
5.3.230.0130.06714.54
5.3.220.0100.03714.36
5.3.210.0070.05314.50
5.3.200.0070.07014.49
5.3.190.0030.07714.51
5.3.180.0100.07314.46
5.3.170.0000.06314.54
5.3.160.0070.05014.46
5.3.150.0070.04014.57
5.3.140.0030.05014.38
5.3.130.0130.04314.47
5.3.120.0030.04014.64
5.3.110.0070.04714.37
5.3.100.0070.07013.82
5.3.90.0030.07713.84
5.3.80.0000.07713.84
5.3.70.0130.07713.95
5.3.60.0070.07313.93
5.3.50.0070.05313.76
5.3.40.0100.04013.88
5.3.30.0070.03713.73
5.3.20.0070.06313.62
5.3.10.0000.05013.60
5.3.00.0000.04313.73
5.2.170.0030.06311.10
5.2.160.0070.06311.13
5.2.150.0070.04311.08
5.2.140.0070.06311.04
5.2.130.0000.04010.93
5.2.120.0030.02711.04
5.2.110.0030.03711.03
5.2.100.0030.06310.98
5.2.90.0030.03311.07
5.2.80.0030.03711.04
5.2.70.0070.03711.06
5.2.60.0030.04711.04
5.2.50.0030.03010.96
5.2.40.0100.05010.88
5.2.30.0130.03011.05
5.2.20.0030.06310.81
5.2.10.0000.06310.74
5.2.00.0030.03010.57
5.1.60.0100.03710.01
5.1.50.0130.0439.90
5.1.40.0030.02310.03
5.1.30.0070.04710.36
5.1.20.0000.06710.38
5.1.10.0000.0479.97
5.1.00.0030.03710.00
5.0.50.0030.0478.55
5.0.40.0030.0478.37
5.0.30.0000.0538.23
5.0.20.0000.0478.11
5.0.10.0030.0278.13
5.0.00.0070.0278.17
4.4.90.0070.0238.00
4.4.80.0000.0278.00
4.4.70.0000.0208.00
4.4.60.0000.0408.00
4.4.50.0000.0378.00
4.4.40.0030.0408.00
4.4.30.0000.0178.00
4.4.20.0000.0378.00
4.4.10.0030.0278.00
4.4.00.0070.0478.00
4.3.110.0030.0238.00
4.3.100.0030.0338.00
4.3.90.0000.0378.00
4.3.80.0030.0538.00
4.3.70.0030.0378.00
4.3.60.0030.0308.00
4.3.50.0030.0338.00
4.3.40.0000.0538.00
4.3.30.0030.0208.00
4.3.20.0100.0308.00
4.3.10.0000.0378.00
4.3.00.0000.0378.00

preferences:
47.38 ms | 400 KiB | 5 Q