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}]~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.01418.43
8.3.50.0110.00922.05
8.3.40.0150.00018.96
8.3.30.0030.01018.92
8.3.20.0080.00020.34
8.3.10.0030.00521.92
8.3.00.0080.00022.30
8.2.180.0040.01516.75
8.2.170.0130.00722.96
8.2.160.0000.01419.15
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00419.48
8.2.110.0090.00020.47
8.2.100.0060.00618.03
8.2.90.0050.00319.23
8.2.80.0000.00817.97
8.2.70.0030.00517.75
8.2.60.0090.00017.93
8.2.50.0000.00818.07
8.2.40.0050.00320.07
8.2.30.0050.00218.08
8.2.20.0040.00417.77
8.2.10.0080.00017.95
8.2.00.0000.00717.91
8.1.280.0120.00625.92
8.1.270.0050.00322.20
8.1.260.0050.00526.35
8.1.250.0040.00428.09
8.1.240.0070.00419.66
8.1.230.0070.00317.45
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0100.00017.34
8.1.190.0000.00717.41
8.1.180.0000.00918.70
8.1.170.0050.00318.73
8.1.160.0000.00722.18
8.1.150.0030.00718.75
8.1.140.0000.00717.48
8.1.130.0040.00417.73
8.1.120.0040.00417.64
8.1.110.0040.00417.58
8.1.100.0070.00017.59
8.1.90.0040.00417.48
8.1.80.0050.00217.63
8.1.70.0040.00417.58
8.1.60.0000.00817.75
8.1.50.0080.00017.66
8.1.40.0040.00417.70
8.1.30.0000.00717.72
8.1.20.0080.00017.86
8.1.10.0020.00517.57
8.1.00.0000.00917.50
8.0.300.0030.00518.77
8.0.290.0040.00416.75
8.0.280.0040.00418.47
8.0.270.0000.00717.38
8.0.260.0040.00416.98
8.0.250.0030.00317.00
8.0.240.0080.00017.13
8.0.230.0070.00016.95
8.0.220.0070.00017.01
8.0.210.0000.00817.05
8.0.200.0030.00316.91
8.0.190.0000.00817.04
8.0.180.0000.00816.93
8.0.170.0070.00016.99
8.0.160.0050.00216.92
8.0.150.0040.00416.81
8.0.140.0040.00416.96
8.0.130.0070.00013.35
8.0.120.0040.00416.84
8.0.110.0050.00316.82
8.0.100.0080.00016.79
8.0.90.0040.00416.89
8.0.80.0090.00617.02
8.0.70.0000.00816.86
8.0.60.0000.00716.94
8.0.50.0000.00716.84
8.0.30.0110.01017.04
8.0.20.0120.00717.40
8.0.10.0040.00417.29
8.0.00.0110.00916.98
7.4.330.0000.00515.00
7.4.320.0000.00816.74
7.4.300.0000.00616.84
7.4.290.0000.00716.79
7.4.280.0080.00316.81
7.4.270.0000.00716.83
7.4.260.0000.00716.74
7.4.250.0030.00516.82
7.4.240.0040.00416.78
7.4.230.0070.00016.52
7.4.220.0130.00616.82
7.4.210.0090.00516.85
7.4.200.0080.00016.75
7.4.190.0000.00816.90
7.4.160.0150.00316.88
7.4.150.0070.01017.40
7.4.140.0080.01417.86
7.4.130.0110.01016.78
7.4.120.0100.00816.86
7.4.110.0070.01016.49
7.4.100.0180.00716.78
7.4.90.0090.00916.73
7.4.80.0130.01219.39
7.4.70.0140.01016.70
7.4.60.0140.00316.75
7.4.50.0040.00416.78
7.4.40.0110.00022.77
7.4.30.0110.00816.73
7.4.10.0100.01015.29
7.4.00.0100.00815.24
7.3.330.0000.00513.18
7.3.320.0050.00013.23
7.3.310.0070.00016.21
7.3.300.0030.00316.21
7.3.290.0110.00816.35
7.3.280.0130.00416.35
7.3.270.0140.00317.40
7.3.260.0130.00616.45
7.3.250.0090.00816.38
7.3.240.0090.00916.57
7.3.230.0090.01216.63
7.3.210.0190.00416.78
7.3.200.0070.01019.39
7.3.190.0160.00416.38
7.3.180.0140.00316.68
7.3.170.0130.00616.38
7.3.160.0030.01416.52
7.3.130.0070.01014.91
7.3.120.0070.01014.72
7.3.110.0030.01614.52
7.3.100.0100.00314.82
7.3.90.0040.00715.18
7.3.80.0060.00314.61
7.3.70.0030.01415.11
7.3.60.0030.01315.05
7.3.50.0000.00914.63
7.3.40.0040.00814.73
7.3.30.0070.00715.04
7.3.20.0150.00016.81
7.3.10.0120.00016.82
7.3.00.0040.01116.69
7.2.330.0090.00916.75
7.2.320.0110.00916.81
7.2.310.0140.00316.67
7.2.300.0070.01116.77
7.2.290.0000.01816.65
7.2.260.0110.00715.09
7.2.250.0100.00315.17
7.2.240.0040.01115.13
7.2.230.0070.00415.33
7.2.220.0000.01615.17
7.2.210.0040.01215.09
7.2.200.0070.00714.93
7.2.190.0040.00715.29
7.2.180.0040.00815.14
7.2.170.0040.01215.16
7.2.160.0130.00315.13
7.2.150.0070.00717.05
7.2.140.0040.01117.06
7.2.130.0030.01017.01
7.2.120.0040.00717.03
7.2.110.0040.01217.11
7.2.100.0100.00717.00
7.2.90.0070.00717.05
7.2.80.0060.00617.12
7.2.70.0030.00917.02
7.2.60.0070.00716.89
7.2.50.0070.00717.12
7.2.40.0120.00616.97
7.2.30.0100.00317.06
7.2.20.0100.00717.10
7.2.10.0100.00617.07
7.2.00.0050.01118.35
7.1.330.0030.01315.95
7.1.320.0000.00915.92
7.1.310.0100.00316.05
7.1.300.0000.01115.99
7.1.290.0120.00015.73
7.1.280.0030.00915.62
7.1.270.0030.01315.98
7.1.260.0080.00615.94
7.1.250.0040.00716.04
7.1.240.0060.00915.89
7.1.230.0000.01516.11
7.1.220.0100.00316.04
7.1.210.0030.00615.76
7.1.200.0050.00915.88
7.1.190.0030.01016.16
7.1.180.0080.00516.11
7.1.170.0030.00615.90
7.1.160.0100.00315.98
7.1.150.0070.00416.09
7.1.140.0060.00615.96
7.1.130.0130.00315.74
7.1.120.0060.00915.89
7.1.110.0090.00615.87
7.1.100.0080.00617.21
7.1.90.0060.00616.20
7.1.80.0040.01115.82
7.1.70.0010.00916.44
7.1.60.0060.00616.83
7.1.50.0050.01316.47
7.1.40.0080.00015.91
7.1.30.0060.00615.74
7.1.20.0060.01016.00
7.1.10.0030.01216.17
7.1.00.0030.04919.16
7.0.330.0080.00515.71
7.0.320.0080.00015.72
7.0.310.0030.01315.74
7.0.300.0000.01615.55
7.0.290.0090.00615.45
7.0.280.0000.01115.55
7.0.270.0060.00615.30
7.0.260.0100.00015.65
7.0.250.0110.00315.50
7.0.240.0070.00715.39
7.0.230.0100.00315.68
7.0.220.0060.00615.52
7.0.210.0030.00715.77
7.0.200.0030.01116.33
7.0.190.0080.00615.70
7.0.180.0040.00415.76
7.0.170.0080.00315.70
7.0.160.0100.00715.75
7.0.150.0040.01115.52
7.0.140.0000.04118.84
7.0.130.0080.00615.57
7.0.120.0060.00915.77
7.0.110.0040.00715.74
7.0.100.0110.00315.40
7.0.90.0030.00615.38
7.0.80.0030.00915.66
7.0.70.0030.01015.61
7.0.60.0080.04117.75
7.0.50.0070.03016.84
7.0.40.0070.02416.92
7.0.30.0150.04216.71
7.0.20.0160.03016.80
7.0.10.0050.03516.85
7.0.00.0050.04916.89
5.6.400.0080.00414.57
5.6.390.0070.01014.34
5.6.380.0100.00013.98
5.6.370.0060.00914.17
5.6.360.0000.01414.58
5.6.350.0030.01014.48
5.6.340.0030.01014.51
5.6.330.0030.00914.34
5.6.320.0110.00314.31
5.6.310.0000.01014.61
5.6.300.0030.01014.30
5.6.290.0100.00314.51
5.6.280.0100.03717.93
5.6.270.0040.00814.18
5.6.260.0070.00314.46
5.6.250.0040.00814.27
5.6.240.0060.00914.21
5.6.230.0030.01214.22
5.6.220.0000.01214.25
5.6.210.0070.02217.37
5.6.200.0070.02016.33
5.6.190.0080.02317.55
5.6.180.0150.03317.28
5.6.170.0130.03517.48
5.6.160.0030.05217.38
5.6.150.0020.03216.25
5.6.140.0080.04616.35
5.6.130.0120.03516.32
5.6.120.0050.02617.90
5.6.110.0050.04617.63
5.6.100.0090.04417.66
5.6.90.0090.04117.60
5.6.80.0050.04417.38
5.6.70.0000.01114.25
5.6.60.0060.00914.26
5.6.50.0070.00714.36
5.6.40.0060.00814.30
5.6.30.0030.01314.21
5.6.20.0030.01014.22
5.6.10.0030.01014.31
5.6.00.0040.01114.24
5.5.380.0070.00314.54
5.5.370.0140.00314.46
5.5.360.0080.00314.64
5.5.350.0050.04817.31
5.5.340.0070.03916.12
5.5.330.0060.02317.18
5.5.320.0220.02817.26
5.5.310.0230.03517.21
5.5.300.0080.04316.10
5.5.290.0080.03215.95
5.5.280.0050.02517.50
5.5.270.0100.03317.59
5.5.260.0100.04217.54
5.5.250.0030.03817.28
5.5.240.0080.04117.16
5.5.230.0000.01614.53
5.5.220.0090.00314.43
5.5.210.0110.00413.95
5.5.200.0000.01614.22
5.5.190.0040.01214.18
5.5.180.0040.01414.14
5.5.170.0100.00614.43
5.5.160.0080.00814.14
5.5.150.0030.01014.11
5.5.140.0060.00614.07
5.5.130.0110.00414.30
5.5.120.0060.01214.08
5.5.110.0120.00414.14
5.5.100.0000.01414.32
5.5.90.0120.00614.32
5.5.80.0110.00014.13
5.5.70.0030.01014.33
5.5.60.0100.00714.22
5.5.50.0030.00914.40
5.5.40.0070.00714.17
5.5.30.0060.00314.07
5.5.20.0030.00714.05
5.5.10.0040.00814.15
5.5.00.0090.00614.13
5.4.450.0040.02615.43
5.4.440.0050.02615.58
5.4.430.0050.03515.51
5.4.420.0030.04315.52
5.4.410.0030.04115.47
5.4.400.0030.03415.35
5.4.390.0080.03815.26
5.4.380.0030.04015.36
5.4.370.0060.03115.27
5.4.360.0030.04115.37
5.4.350.0040.04115.19
5.4.340.0030.03515.34
5.4.330.0070.00311.61
5.4.320.0070.03515.26
5.4.310.0040.04115.32
5.4.300.0070.03815.33
5.4.290.0050.02415.43
5.4.280.0060.02515.25
5.4.270.0050.03015.25
5.4.260.0020.02915.42
5.4.250.0040.02715.24
5.4.240.0050.03015.37
5.4.230.0020.03815.42
5.4.220.0070.03815.42
5.4.210.0050.04115.27
5.4.200.0070.03415.37
5.4.190.0030.03815.27
5.4.180.0030.03815.28
5.4.170.0030.04015.34
5.4.160.0050.04115.35
5.4.150.0000.03915.25
5.4.140.0020.03514.08
5.4.130.0050.03514.03
5.4.120.0040.04013.88
5.4.110.0030.04313.90
5.4.100.0030.04114.01
5.4.90.0050.03614.04
5.4.80.0040.02914.00
5.4.70.0060.03013.83
5.4.60.0070.03514.02
5.4.50.0000.03214.01
5.4.40.0030.03813.96
5.4.30.0080.03313.89
5.4.20.0030.03814.02
5.4.10.0050.04014.03
5.4.00.0060.03713.64
5.3.290.0080.03513.19
5.3.280.0030.02713.03
5.3.270.0040.03513.09
5.3.260.0020.02313.04
5.3.250.0000.03513.05
5.3.240.0060.04013.03
5.3.230.0030.03613.08
5.3.220.0000.04413.06
5.3.210.0030.04013.06
5.3.200.0050.03813.08
5.3.190.0050.03513.03
5.3.180.0000.04013.02
5.3.170.0030.02813.07
5.3.160.0040.03213.01
5.3.150.0080.03313.06
5.3.140.0020.03813.06
5.3.130.0070.03713.00
5.3.120.0010.04313.07
5.3.110.0030.03813.11
5.3.100.0050.02312.74
5.3.90.0050.03512.77
5.3.80.0030.03112.74
5.3.70.0040.03912.71
5.3.60.0050.03512.71
5.3.50.0020.04012.75
5.3.40.0050.03912.70
5.3.30.0100.02112.72
5.3.20.0030.03712.57
5.3.10.0040.03712.61
5.3.00.0040.03712.67
5.2.170.0030.03012.22
5.2.160.0030.06312.22
5.2.150.0000.06712.22
5.2.140.0000.06712.22
5.2.130.0070.05712.22
5.2.120.0030.05712.22
5.2.110.0000.04312.22
5.2.100.0030.06012.22
5.2.90.0100.05312.22
5.2.80.0100.04712.22
5.2.70.0030.05712.22
5.2.60.0100.05312.22
5.2.50.0070.04712.22
5.2.40.0000.05312.22
5.2.30.0030.04712.22
5.2.20.0030.03712.22
5.2.10.0030.06012.22
5.2.00.0070.05712.22
5.1.60.0030.04312.22
5.1.50.0070.05312.22
5.1.40.0100.05012.22
5.1.30.0100.05012.22
5.1.20.0070.04712.22
5.1.10.0030.05712.22
5.1.00.0070.05312.22
5.0.50.0000.04012.22
5.0.40.0070.04012.22
5.0.30.0000.05312.22
5.0.20.0030.03312.22
5.0.10.0030.03712.22
5.0.00.0100.03712.22
4.4.90.0000.02312.22
4.4.80.0030.02712.22
4.4.70.0070.02312.22
4.4.60.0000.03712.22
4.4.50.0030.03012.22
4.4.40.0000.05712.22
4.4.30.0030.02712.22
4.4.20.0030.03712.22
4.4.10.0070.03312.22
4.4.00.0000.04712.22
4.3.110.0030.03712.22
4.3.100.0030.03312.22
4.3.90.0030.02312.22
4.3.80.0030.03012.22
4.3.70.0070.01712.22
4.3.60.0070.02312.22
4.3.50.0000.02712.22
4.3.40.0030.05012.22
4.3.30.0000.04312.22
4.3.20.0000.03312.22
4.3.10.0000.02312.22
4.3.00.0030.02312.22

preferences:
40.79 ms | 401 KiB | 5 Q