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}\x{00c2}]~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.0210.00016.61
8.3.50.0120.00817.39
8.3.40.0070.01018.83
8.3.30.0040.01118.85
8.3.20.0080.00018.85
8.3.10.0000.00820.70
8.3.00.0050.00317.63
8.2.180.0150.00016.63
8.2.170.0170.00322.96
8.2.160.0130.00722.21
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0040.00419.77
8.2.110.0110.00021.17
8.2.100.0040.00818.03
8.2.90.0000.00917.75
8.2.80.0000.00817.97
8.2.70.0030.00618.03
8.2.60.0080.00017.92
8.2.50.0060.00319.78
8.2.40.0060.00320.50
8.2.30.0050.00318.10
8.2.20.0050.00317.80
8.2.10.0050.00217.81
8.2.00.0050.00317.93
8.1.280.0040.01125.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0070.00728.09
8.1.240.0090.00922.39
8.1.230.0000.01120.89
8.1.220.0040.00417.78
8.1.210.0000.00818.77
8.1.200.0100.00017.35
8.1.190.0060.00317.35
8.1.180.0040.00418.10
8.1.170.0050.00318.66
8.1.160.0040.00418.83
8.1.150.0100.00018.84
8.1.140.0030.00617.63
8.1.130.0030.00317.80
8.1.120.0040.00417.52
8.1.110.0040.00417.54
8.1.100.0000.00717.61
8.1.90.0050.00317.64
8.1.80.0040.00417.62
8.1.70.0030.00517.58
8.1.60.0000.00917.65
8.1.50.0040.00417.49
8.1.40.0000.00717.61
8.1.30.0040.00417.80
8.1.20.0000.00817.71
8.1.10.0040.00417.70
8.1.00.0050.00317.46
8.0.300.0000.00719.90
8.0.290.0050.00316.75
8.0.280.0030.00318.48
8.0.270.0000.00817.29
8.0.260.0030.00316.89
8.0.250.0040.00417.10
8.0.240.0040.00416.99
8.0.230.0040.00417.06
8.0.220.0020.00516.89
8.0.210.0030.00316.97
8.0.200.0040.00416.92
8.0.190.0080.00017.09
8.0.180.0060.00316.86
8.0.170.0050.00316.93
8.0.160.0000.00817.10
8.0.150.0060.00316.98
8.0.140.0040.00416.96
8.0.130.0050.00013.38
8.0.120.0000.00816.90
8.0.110.0030.00616.94
8.0.100.0040.00416.79
8.0.90.0000.00816.98
8.0.80.0030.01316.98
8.0.70.0000.00716.85
8.0.60.0040.00416.99
8.0.50.0000.00717.07
8.0.30.0100.01017.20
8.0.20.0090.01017.34
8.0.10.0000.00717.19
8.0.00.0100.01016.96
7.4.330.0000.00514.88
7.4.320.0000.00616.74
7.4.300.0030.00316.71
7.4.290.0040.00416.71
7.4.280.0060.00316.65
7.4.270.0000.00716.81
7.4.260.0030.00313.48
7.4.250.0000.00816.72
7.4.240.0050.00216.73
7.4.230.0020.00516.92
7.4.220.0050.01316.78
7.4.210.0070.00816.71
7.4.200.0060.00316.71
7.4.190.0030.00316.78
7.4.160.0030.01316.73
7.4.150.0130.00617.07
7.4.140.0080.00917.35
7.4.130.0130.00516.69
7.4.120.0110.00916.84
7.4.110.0080.00816.48
7.4.100.0140.00316.71
7.4.90.0100.00716.58
7.4.80.0070.01018.63
7.4.70.0100.00716.53
7.4.60.0040.01416.57
7.4.50.0000.00519.83
7.4.40.0040.00821.69
7.4.30.0110.00716.78
7.4.00.0000.01415.39
7.3.330.0000.00713.12
7.3.320.0060.00013.22
7.3.310.0000.00716.21
7.3.300.0030.00316.38
7.3.290.0090.00616.46
7.3.280.0070.01016.37
7.3.270.0120.00617.07
7.3.260.0090.00718.24
7.3.250.0070.01416.51
7.3.240.0100.00616.35
7.3.230.0060.00916.45
7.3.210.0000.01616.63
7.3.200.0030.01919.39
7.3.190.0090.01316.57
7.3.180.0140.00316.22
7.3.170.0060.00916.39
7.3.160.0060.00916.48
7.3.120.0060.00614.97
7.2.330.0060.01216.71
7.2.320.0040.01316.58
7.2.310.0140.00916.46
7.2.300.0110.01216.61
7.2.290.0130.00416.60
7.1.100.0040.00718.66
7.1.70.0040.00417.38
7.1.60.0140.01019.40
7.1.50.0000.02117.27
7.1.00.0000.05722.34
7.0.200.0000.00816.86
7.0.140.0070.04022.18
7.0.120.0000.03322.17
7.0.60.0030.09019.92
7.0.50.0070.05717.91
7.0.40.0000.04720.03
7.0.30.0270.03720.15
7.0.20.0300.07020.16
7.0.10.0300.06320.06
7.0.00.0070.05720.03
5.6.280.0070.07020.92
5.6.210.0130.07320.71
5.6.200.0070.09018.10
5.6.190.0030.09320.60
5.6.180.0270.05720.41
5.6.170.0300.06720.54
5.6.160.0030.04320.72
5.6.150.0030.04718.22
5.6.140.0070.08018.07
5.6.130.0100.03318.08
5.6.120.0030.04021.12
5.6.110.0130.08321.13
5.6.100.0100.07021.03
5.6.90.0000.05720.96
5.6.80.0030.04020.50
5.6.70.3730.03720.50
5.5.350.0330.07320.48
5.5.340.0100.07317.88
5.5.330.0030.05320.23
5.5.320.0000.06020.40
5.5.310.0330.04720.29
5.5.300.0000.04317.93
5.5.290.0000.04317.96
5.5.280.0070.04720.90
5.5.270.0100.08320.79
5.5.260.0170.07720.79
5.5.250.0000.09020.58
5.5.240.0070.06720.15
5.4.450.0070.09019.51
5.4.440.0030.08319.26
5.4.430.0030.05319.12
5.4.420.0100.07719.40
5.4.410.0100.07319.37
5.4.400.0000.05019.09
5.4.390.0030.04019.12
5.4.380.0030.07319.12
5.4.370.0070.04718.79
5.4.360.0100.05318.81
5.4.350.0130.06019.17
5.4.340.0100.04318.91
5.4.320.0070.05319.18
5.4.310.0070.07019.11
5.4.300.0100.07018.80
5.4.290.0100.06319.11
5.4.280.0070.07318.80
5.4.270.0070.08019.18
5.4.260.0030.07318.78
5.4.250.0070.07719.07
5.4.240.0000.04319.17
5.4.230.0100.04719.08
5.4.220.0030.08019.08
5.4.210.0030.08319.17
5.4.200.0000.04319.04
5.4.190.0070.05718.91
5.4.180.0100.04018.80
5.4.170.0100.06018.91
5.4.160.0030.06318.77
5.4.150.0100.04319.06
5.4.140.0000.04016.33
5.4.130.0070.07316.21
5.4.120.0030.04316.20
5.4.110.0000.04016.40
5.4.100.0030.04016.60
5.4.90.0070.04316.30
5.4.80.0100.06316.39
5.4.70.0070.07016.34
5.4.60.0030.07016.32
5.4.50.0100.07016.25
5.4.40.0100.03016.26
5.4.30.0000.07716.32
5.4.20.0100.05016.21
5.4.10.0030.07316.27
5.4.00.0030.05715.67
5.3.290.0100.07014.63
5.3.280.0030.05314.52
5.3.270.0070.04014.58
5.3.260.0070.06014.70
5.3.250.0000.08314.49
5.3.240.0100.03314.40
5.3.230.0070.04314.55
5.3.220.0030.04014.47
5.3.210.0130.03714.50
5.3.200.0000.04314.39
5.3.190.0100.07014.66
5.3.180.0030.04714.49
5.3.170.0000.04714.35
5.3.160.0030.04714.46
5.3.150.0070.08014.45
5.3.140.0030.04314.48
5.3.130.0070.05014.50
5.3.120.0000.06714.49
5.3.110.0030.08314.56
5.3.100.0100.06313.99
5.3.90.0030.08013.95
5.3.80.0100.06014.00
5.3.70.0100.06313.84
5.3.60.0070.03713.93
5.3.50.0030.05013.91
5.3.40.0070.04713.89
5.3.30.0100.05313.86
5.3.20.0030.07313.63
5.3.10.0000.04313.58
5.3.00.0000.05313.58
5.2.170.0130.02011.11
5.2.160.0070.05711.17
5.2.150.0070.05011.09
5.2.140.0000.03711.11
5.2.130.0000.06710.96
5.2.120.0030.05011.00
5.2.110.0000.06711.05
5.2.100.0030.06011.03
5.2.90.0100.06011.00
5.2.80.0100.05711.02
5.2.70.0070.06311.08
5.2.60.0100.05310.87
5.2.50.0100.05711.01
5.2.40.0030.04710.86
5.2.30.0030.03310.91
5.2.20.0030.03710.95
5.2.10.0000.03310.86
5.2.00.0130.05310.61
5.1.60.0070.0539.99
5.1.50.0070.0509.95
5.1.40.0030.0239.98
5.1.30.0030.02310.32
5.1.20.0030.02710.39
5.1.10.0030.02310.04
5.1.00.0030.02710.22
5.0.50.0030.0238.61
5.0.40.0000.0238.46
5.0.30.0000.0308.24
5.0.20.0000.0208.27
5.0.10.0030.0178.33
5.0.00.0000.0308.21
4.4.90.0030.0337.82
4.4.80.0100.0307.82
4.4.70.0070.0277.82
4.4.60.0000.0407.82
4.4.50.0030.0137.82
4.4.40.0070.0437.82
4.4.30.0000.0207.82
4.4.20.0070.0107.82
4.4.10.0000.0177.76
4.4.00.0030.0237.76
4.3.110.0100.0077.76
4.3.100.0070.0107.76
4.3.90.0030.0137.76
4.3.80.0000.0237.76
4.3.70.0000.0137.76
4.3.60.0000.0177.76
4.3.50.0000.0177.76
4.3.40.0030.0207.76
4.3.30.0000.0137.76
4.3.20.0000.0177.76
4.3.10.0000.0137.76
4.3.00.0030.0137.76

preferences:
42.26 ms | 400 KiB | 5 Q