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}]~u', '?', $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.0150.00618.81
8.3.50.0080.01222.17
8.3.40.0070.00718.79
8.3.30.0090.00618.89
8.3.20.0120.00318.91
8.3.10.0000.00721.14
8.3.00.0080.00023.65
8.2.180.0070.01518.48
8.2.170.0110.01122.96
8.2.160.0110.00420.39
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0090.00020.99
8.2.110.0000.00920.39
8.2.100.0030.00917.84
8.2.90.0040.00419.16
8.2.80.0030.00619.28
8.2.70.0030.00617.88
8.2.60.0000.00817.80
8.2.50.0030.00618.07
8.2.40.0000.00918.09
8.2.30.0040.00419.36
8.2.20.0070.00017.79
8.2.10.0040.00417.85
8.2.00.0000.00817.95
8.1.280.0090.00625.92
8.1.270.0000.00723.99
8.1.260.0070.01126.35
8.1.250.0000.00728.09
8.1.240.0030.00622.72
8.1.230.0040.00721.04
8.1.220.0060.00318.77
8.1.210.0030.00618.94
8.1.200.0030.00617.50
8.1.190.0050.00317.51
8.1.180.0030.00518.10
8.1.170.0040.00418.70
8.1.160.0060.00318.93
8.1.150.0000.00818.80
8.1.140.0000.00817.54
8.1.130.0000.00717.82
8.1.120.0070.00017.65
8.1.110.0000.00717.62
8.1.100.0070.00017.61
8.1.90.0030.00317.49
8.1.80.0080.00017.51
8.1.70.0000.00717.59
8.1.60.0030.00617.65
8.1.50.0040.00417.71
8.1.40.0040.00417.67
8.1.30.0040.00417.84
8.1.20.0060.00317.82
8.1.10.0050.00317.72
8.1.00.0070.00317.61
8.0.300.0080.00019.98
8.0.290.0040.00417.05
8.0.280.0030.00318.48
8.0.270.0070.00017.29
8.0.260.0030.00317.04
8.0.250.0000.00717.20
8.0.240.0000.00817.18
8.0.230.0070.00017.06
8.0.220.0030.00317.11
8.0.210.0040.00417.10
8.0.200.0070.00017.20
8.0.190.0050.00217.23
8.0.180.0050.00217.10
8.0.170.0040.00417.14
8.0.160.0030.00617.02
8.0.150.0070.00017.09
8.0.140.0000.00817.10
8.0.130.0000.00513.58
8.0.120.0050.00317.05
8.0.110.0000.00716.95
8.0.100.0000.00817.05
8.0.90.0050.00217.16
8.0.80.0040.01117.03
8.0.70.0000.00717.13
8.0.60.0000.00717.15
8.0.50.0040.00416.98
8.0.30.0110.00817.20
8.0.20.0080.01117.49
8.0.10.0000.00717.24
8.0.00.0090.01216.95
7.4.330.0000.00616.72
7.4.320.0070.00016.85
7.4.300.0060.00016.72
7.4.290.0000.00716.81
7.4.280.0030.00316.73
7.4.270.0030.00616.83
7.4.260.0060.00013.51
7.4.250.0000.00816.73
7.4.240.0000.00716.83
7.4.230.0000.00716.72
7.4.220.0060.01316.72
7.4.210.0080.01016.82
7.4.200.0080.00016.66
7.4.190.0040.00416.95
7.4.160.0060.01616.66
7.4.150.0040.01517.40
7.4.140.0130.00617.86
7.4.130.0100.01016.66
7.4.120.0090.00916.72
7.4.110.0100.00716.86
7.4.100.0030.01816.60
7.4.90.0040.01416.46
7.4.80.0110.00819.39
7.4.70.0000.01716.75
7.4.60.0090.01516.70
7.4.50.0040.00416.55
7.4.40.0060.00922.77
7.4.30.0090.00916.86
7.4.00.0030.01315.05
7.3.330.0050.00013.16
7.3.320.0050.00013.26
7.3.310.0030.00316.35
7.3.300.0020.00516.37
7.3.290.0030.01516.38
7.3.280.0050.01116.45
7.3.270.0070.01017.40
7.3.260.0060.01218.24
7.3.250.0040.01416.72
7.3.240.0100.01016.45
7.3.230.0100.00716.44
7.3.210.0090.00916.65
7.3.200.0160.00619.39
7.3.190.0060.01216.59
7.3.180.0100.01016.32
7.3.170.0150.00416.41
7.3.160.0100.00716.55
7.3.120.0070.01014.54
7.3.10.0140.00016.71
7.3.00.0040.00716.70
7.2.330.0110.00716.77
7.2.320.0060.01316.65
7.2.310.0070.01016.80
7.2.300.0030.01316.61
7.2.290.0070.01016.83
7.2.130.0040.00716.95
7.2.120.0140.00316.86
7.2.110.0000.00917.12
7.2.100.0040.01217.11
7.2.90.0000.01416.77
7.2.80.0100.00317.11
7.2.70.0060.00316.83
7.2.60.0020.01117.10
7.2.50.0040.00717.06
7.2.40.0040.00917.20
7.2.30.0000.01417.13
7.2.20.0100.00317.20
7.2.10.0030.00916.87
7.2.00.0030.01218.18
7.1.250.0100.00316.10
7.1.200.0060.00815.59
7.1.100.0070.01018.35
7.1.70.0040.01318.73
7.1.60.0030.01318.73
7.1.50.0000.01618.73
7.1.40.0080.00418.73
7.1.30.0000.01218.73
7.1.20.0140.00318.73
7.1.10.0030.00718.73
7.1.00.0030.00718.73
7.0.200.0000.01218.73
7.0.190.0000.00818.73
7.0.180.0050.00518.73
7.0.170.0040.01318.73
7.0.160.0030.00918.73
7.0.150.0040.00718.73
7.0.140.0120.00618.73
7.0.130.0000.00818.73
7.0.120.0100.00018.73
7.0.110.0000.01018.73
7.0.100.0030.00518.73
7.0.90.0090.00018.73
7.0.80.0000.00918.73
7.0.70.0000.01018.73
7.0.60.0100.00018.73
7.0.50.0030.00518.73
7.0.40.0060.00318.73
7.0.30.0030.00618.73
7.0.20.0000.01018.73
7.0.10.0000.01118.73
7.0.00.0000.00818.73
5.6.300.0100.03721.00
5.6.290.0000.06720.79
5.6.280.0070.04021.03
5.6.270.0100.06721.03
5.6.260.0030.05420.79
5.6.250.0060.04120.99
5.6.240.0030.04120.86
5.6.230.0030.04420.82
5.6.220.0030.04020.79
5.6.210.0000.05021.00
5.6.200.0030.04720.86
5.6.190.0070.03720.82
5.6.180.0030.04020.95
5.6.170.0030.04320.85
5.6.160.0030.04420.93
5.6.150.0000.05021.04
5.6.140.0030.04220.73
5.6.130.0070.05320.93
5.6.120.0070.04020.85
5.6.110.0030.04320.77
5.6.100.0000.04720.82
5.6.90.0070.03720.72
5.6.80.0030.04020.24
5.6.70.0030.03820.19
5.6.60.0100.05120.38
5.6.50.0030.03820.20
5.6.40.0000.04720.23
5.6.30.0000.04420.31
5.6.20.0030.04420.36
5.6.10.0000.04620.33
5.6.00.0000.04520.28
5.5.380.0030.04118.73
5.5.370.0000.04718.73
5.5.360.0070.03918.73
5.5.350.0000.04818.73
5.5.340.0100.03318.73
5.5.330.0030.04318.73
5.5.320.0030.04018.73
5.5.310.0040.04218.73
5.5.300.0000.04118.73
5.5.290.0060.03818.73
5.5.280.0100.03618.73
5.5.270.0030.04318.73
5.5.260.0070.05518.73
5.5.250.0070.03818.73
5.5.240.0030.04018.73
5.5.230.0060.03518.73
5.5.220.0130.04418.73
5.5.210.0090.03218.73
5.5.200.0000.04318.73
5.5.190.0030.03718.73
5.5.180.0070.03918.73
5.5.160.0030.03718.73
5.5.150.0030.04218.73
5.5.140.0030.04118.73
5.5.130.0030.03618.73
5.5.120.0100.03118.73
5.5.110.0030.04018.73
5.5.100.0000.04318.73
5.5.90.0040.03518.73
5.5.80.0030.03818.73
5.5.70.0000.04018.73
5.5.60.0060.03518.73
5.5.50.0000.04118.73
5.5.40.0200.03018.73
5.5.30.0100.03218.73
5.5.20.0070.03618.73
5.5.10.0060.03418.73
5.5.00.0030.03618.73
5.4.450.0000.04619.27
5.4.440.0030.04319.50
5.4.430.0030.05519.23
5.4.420.0000.04419.17
5.4.410.0000.04619.36
5.4.400.0000.04118.98
5.4.390.0030.04019.17
5.4.380.0130.04718.98
5.4.370.0000.04119.07
5.4.360.0000.04218.96
5.4.350.0100.03219.09
5.4.340.0030.03919.14
5.4.320.0030.04418.98
5.4.310.0030.04418.85
5.4.300.0000.04119.01
5.4.290.0030.03719.01
5.4.280.0060.03619.07
5.4.270.0000.04319.06
5.4.260.0000.04118.97
5.4.250.0140.03518.99
5.4.240.0030.03819.04
5.4.230.0030.04018.97
5.4.220.0000.04418.96
5.4.210.0060.04518.90
5.4.200.0070.03318.84
5.4.190.0030.05519.12
5.4.180.0000.04219.04
5.4.170.0000.04018.82
5.4.160.0300.03619.00
5.4.150.0070.03618.96
5.4.140.0070.03618.73
5.4.130.0000.03718.73
5.4.120.0030.03318.73
5.4.110.0000.03818.73
5.4.100.0000.04118.73
5.4.90.0190.03518.73
5.4.80.0030.03418.73
5.4.70.0170.03418.73
5.4.60.0060.03818.73
5.4.50.0060.03418.73
5.4.40.0140.03218.73
5.4.30.0030.04218.73
5.4.20.0000.03818.73
5.4.10.0000.04018.73
5.4.00.0060.03218.73
5.3.290.0030.03618.73
5.3.280.0030.03718.73
5.3.270.0000.04018.73
5.3.260.0000.04318.73
5.3.250.0100.03818.73
5.3.240.0000.04218.73
5.3.230.0000.04018.73
5.3.220.0030.03718.73
5.3.210.0550.03918.73
5.3.200.0000.03918.73
5.3.190.0000.04318.73
5.3.180.0160.04318.73
5.3.170.0030.03718.73
5.3.160.0060.03718.73
5.3.150.0060.03618.73
5.3.140.0210.03118.73
5.3.130.0070.03718.73
5.3.120.0000.04418.73
5.3.110.0000.04218.73
5.3.100.0030.04018.73
5.3.90.0230.03218.73
5.3.80.0000.04018.73
5.3.70.0030.03818.73
5.3.60.0000.03818.73
5.3.50.0030.03318.73
5.3.40.0030.03718.73
5.3.30.0040.03518.73
5.3.20.0070.03718.73
5.3.10.0040.04318.73
5.3.00.0030.03818.73
5.2.170.0030.03818.73
5.2.160.0030.02918.73
5.2.150.0000.03818.73
5.2.140.0030.03018.73
5.2.130.0030.03318.73
5.2.120.0000.03618.73
5.2.110.0100.03218.73
5.2.100.0000.03218.73
5.2.90.0160.03018.73
5.2.80.0000.03318.73
5.2.70.0090.03518.73
5.2.60.0070.03018.73
5.2.50.0000.03618.73
5.2.40.0060.02818.73
5.2.30.0030.03118.73
5.2.20.0000.03818.73
5.2.10.0030.03018.73
5.2.00.0060.02818.73
5.1.60.0030.02718.73
5.1.50.0000.02818.73
5.1.40.0030.02518.73
5.1.30.0030.02618.73
5.1.20.0060.02718.73
5.1.10.0000.03018.73
5.1.00.0000.03018.73
5.0.50.0000.02318.73
5.0.40.0110.01118.73
5.0.30.0030.03518.73
5.0.20.0000.02218.73
5.0.10.0000.02818.73
5.0.00.0000.03618.73
4.4.90.0000.01718.73
4.4.80.0000.01718.73
4.4.70.0000.01718.73
4.4.60.0030.01518.73
4.4.50.0000.01718.73
4.4.40.0040.02218.73
4.4.30.0000.02018.73
4.4.20.0000.01918.73
4.4.10.0070.01018.73
4.4.00.0030.02818.73
4.3.110.0000.01818.73
4.3.100.0030.01418.73
4.3.90.0030.01618.73
4.3.80.0000.02718.73
4.3.70.0000.01918.73
4.3.60.0030.01318.73
4.3.50.0030.01518.73
4.3.40.0030.02318.73
4.3.30.0000.01918.73
4.3.20.0000.01918.73
4.3.10.0000.01818.73
4.3.00.0000.01818.73

preferences:
47.32 ms | 401 KiB | 5 Q