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); echo @iconv("UTF-8", "UTF-8//IGNORE", $result); exit; $result = preg_replace('~[\x{0000}-\x{000F}\x{007F}-\x{00a0}]~', '?', $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.0060.01018.43
8.3.50.0110.00518.40
8.3.40.0060.00918.70
8.3.30.0110.00418.89
8.3.20.0030.00518.73
8.3.10.0040.00418.73
8.3.00.0030.00519.38
8.2.180.0180.00316.75
8.2.170.0070.01122.96
8.2.160.0070.00718.75
8.2.150.0030.00624.18
8.2.140.0070.01124.66
8.2.130.0140.00026.16
8.2.120.0050.00319.50
8.2.110.0060.00319.45
8.2.100.0040.00717.84
8.2.90.0030.00619.23
8.2.80.0050.00317.97
8.2.70.0070.00317.63
8.2.60.0000.00718.04
8.2.50.0040.00417.93
8.2.40.0030.00619.47
8.2.30.0040.00717.67
8.2.20.0090.00017.70
8.2.10.0060.00317.76
8.2.00.0000.00717.85
8.1.280.0160.00625.92
8.1.270.0080.00023.99
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00619.52
8.1.230.0040.00720.84
8.1.220.0000.00917.79
8.1.210.0060.00320.38
8.1.200.0060.00317.35
8.1.190.0040.00417.36
8.1.180.0080.00018.10
8.1.170.0060.00318.86
8.1.160.0040.00419.04
8.1.150.0040.00418.75
8.1.140.0040.00417.55
8.1.130.0000.00717.41
8.1.120.0050.00217.53
8.1.110.0030.00617.51
8.1.100.0000.00817.46
8.1.90.0030.00317.48
8.1.80.0050.00317.48
8.1.70.0030.00517.43
8.1.60.0040.00417.58
8.1.50.0040.00417.43
8.1.40.0000.00717.60
8.1.30.0030.00617.52
8.1.20.0060.00617.56
8.1.10.0040.00417.52
8.1.00.0020.00517.36
8.0.300.0000.00819.97
8.0.290.0040.00416.88
8.0.280.0020.00518.60
8.0.270.0030.00317.29
8.0.260.0000.00916.91
8.0.250.0080.00316.96
8.0.240.0100.00017.08
8.0.230.0080.00017.04
8.0.220.0000.00716.98
8.0.210.0000.00717.03
8.0.200.0030.00317.00
8.0.190.0040.00416.90
8.0.180.0040.00417.04
8.0.170.0000.00816.88
8.0.160.0000.00816.97
8.0.150.0080.00016.98
8.0.140.0000.00816.89
8.0.130.0000.00513.38
8.0.120.0060.00317.05
8.0.110.0030.00617.15
8.0.100.0030.00616.93
8.0.90.0030.00617.02
8.0.80.0060.01217.08
8.0.70.0060.00317.00
8.0.60.0050.00516.96
8.0.50.0030.00617.16
8.0.30.0090.00917.39
8.0.20.0090.01117.27
8.0.10.0000.00917.30
8.0.00.0120.00917.13
7.4.330.0000.00613.10
7.4.320.0000.00616.44
7.4.300.0060.00016.65
7.4.290.0000.01116.66
7.4.280.0000.00716.38
7.4.270.0060.00316.46
7.4.260.0000.00513.20
7.4.250.0000.00916.77
7.4.240.0030.00516.81
7.4.230.0040.00416.79
7.4.220.0070.01316.65
7.4.210.0000.01716.80
7.4.200.0030.00516.88
7.4.190.0030.00616.91
7.4.160.0070.01116.72
7.4.150.0130.00616.68
7.4.140.0090.01617.86
7.4.130.0060.01916.75
7.4.120.0070.01416.45
7.4.110.0090.01216.70
7.4.100.0170.00316.61
7.4.90.0130.01216.66
7.4.80.0130.00619.39
7.4.70.0180.00616.64
7.4.60.0150.00616.43
7.4.50.0100.00716.58
7.4.40.0110.01016.81
7.4.30.0150.00616.26
7.4.20.0160.01516.66
7.4.10.0080.01316.52
7.4.00.0020.01415.82
7.3.330.0000.00613.09
7.3.320.0040.00413.03
7.3.310.0050.00316.42
7.3.300.0040.00416.40
7.3.290.0080.00916.37
7.3.280.0070.01316.32
7.3.270.0060.01316.63
7.3.260.0100.01316.39
7.3.240.0040.01416.60
7.3.230.0030.01616.34
7.3.210.0090.01016.60
7.3.200.0090.01116.77
7.3.190.0150.00816.56
7.3.180.0100.01016.33
7.3.170.0140.01216.40
7.3.160.0150.00916.36
7.3.150.0170.00916.70
7.3.140.0100.01316.50
7.3.130.0160.00516.38
7.3.120.0090.01115.64
7.3.110.0170.01016.29
7.3.100.0250.00016.32
7.3.90.0150.01016.39
7.3.80.0260.01016.57
7.3.70.0180.01316.36
7.3.60.0250.00416.35
7.3.50.0220.00416.43
7.3.40.0250.00916.42
7.3.30.0200.01416.43
7.3.20.0070.01116.41
7.3.10.0100.01016.61
7.3.00.0130.00816.55
7.2.330.0180.00616.79
7.2.320.0060.01316.71
7.2.310.0110.01116.68
7.2.300.0170.00516.59
7.2.290.0100.00816.74
7.2.280.0160.01616.80
7.2.270.0160.01716.45
7.2.260.0170.00716.28
7.2.250.0040.02016.66
7.2.240.0090.01616.72
7.2.230.0130.01016.73
7.2.220.0190.00816.56
7.2.210.0220.01316.47
7.2.200.0170.01716.63
7.2.190.0000.02316.14
7.2.180.0150.01816.54
7.2.170.0220.01016.38
7.2.160.0160.01316.53
7.2.150.0030.01616.48
7.2.140.0120.01216.55
7.2.130.0230.00616.58
7.2.120.0050.01516.45
7.2.110.0160.00316.65
7.2.100.0110.01116.78
7.2.90.0090.00916.71
7.2.80.0090.01216.64
7.2.70.0140.00616.64
7.2.60.0160.01016.73
7.2.50.0040.01516.91
7.2.40.0210.00316.65
7.2.30.0170.01116.65
7.2.20.0100.01016.68
7.2.10.0130.00816.54
7.2.00.0130.00918.11
7.1.330.0160.01215.72
7.1.320.0260.01315.46
7.1.310.0220.01315.66
7.1.300.0240.00615.84
7.1.290.0220.01115.71
7.1.280.0210.01615.66
7.1.270.0180.01115.63
7.1.260.0260.00415.63
7.1.250.0120.01915.57
7.1.240.0190.01115.52
7.1.230.0310.00415.63
7.1.220.0220.00815.47
7.1.210.0240.00615.57
7.1.200.0080.01315.81
7.1.190.0230.01015.62
7.1.180.0240.00715.62
7.1.170.0230.01315.64
7.1.160.0200.01415.67
7.1.150.0150.01415.72
7.1.140.0180.01115.66
7.1.130.0230.00615.66
7.1.120.0130.01315.71
7.1.110.0250.00815.77
7.1.100.0280.01615.56
7.1.90.0180.01115.66
7.1.80.0130.01615.83
7.1.70.0140.00516.52
7.1.60.0190.01217.43
7.1.50.0180.01725.17
7.1.40.0210.01015.67
7.1.30.0190.01015.45
7.1.20.0210.01015.61
7.1.10.0240.01315.70
7.1.00.0220.02819.09
7.0.330.0260.00315.52
7.0.320.0190.00815.50
7.0.310.0130.01615.22
7.0.300.0240.01815.55
7.0.290.0250.00715.46
7.0.280.0200.01015.29
7.0.270.0230.01115.39
7.0.260.0300.00415.23
7.0.250.0180.01115.47
7.0.240.0230.00515.37
7.0.230.0090.01915.34
7.0.220.0200.00915.21
7.0.210.0250.00715.35
7.0.200.0090.00916.15
7.0.190.0210.00915.25
7.0.180.0170.01215.36
7.0.170.0210.01115.42
7.0.160.0220.01115.42
7.0.150.0230.00715.22
7.0.140.0130.03818.85
7.0.130.0180.00915.23
7.0.120.0160.03618.76
7.0.110.0240.01215.34
7.0.100.0100.01915.32
7.0.90.0190.01015.49
7.0.80.0240.00715.35
7.0.70.0120.01915.19
7.0.60.0130.03418.65
7.0.50.0160.04716.63
7.0.40.0160.03717.90
7.0.30.0220.03617.79
7.0.20.0320.03917.75
7.0.10.0090.05117.91
7.0.00.0120.05217.80
5.6.400.0210.01116.35
5.6.390.0180.01516.13
5.6.380.0160.01615.88
5.6.370.0170.01216.02
5.6.360.0190.01116.32
5.6.350.0200.01216.17
5.6.340.0180.01216.01
5.6.330.0210.01215.73
5.6.320.0160.01616.04
5.6.310.0250.00516.21
5.6.300.0280.00316.00
5.6.290.0230.01416.06
5.6.280.0090.04518.50
5.6.270.0160.01616.27
5.6.260.0180.01316.10
5.6.250.0200.01116.12
5.6.240.0190.01115.90
5.6.230.0090.02216.24
5.6.220.0270.00716.00
5.6.210.0120.04918.27
5.6.200.0140.04717.23
5.6.190.0120.02718.26
5.6.180.0200.02718.40
5.6.170.0220.03518.23
5.6.160.0150.02518.34
5.6.150.0120.02417.10
5.6.140.0070.04517.19
5.6.130.0120.02617.12
5.6.120.0140.04718.61
5.6.110.0190.04718.49
5.6.100.0180.03818.56
5.6.90.0110.05418.50
5.6.80.0150.04418.29
5.6.70.0130.01715.96
5.6.60.0180.01115.99
5.6.50.0140.01815.94
5.6.40.0200.01015.97
5.6.30.0220.00815.91
5.6.20.0160.01215.87
5.6.10.0180.01516.00
5.6.00.0210.01215.74
5.5.380.0180.01815.86
5.5.370.0280.00315.99
5.5.360.0220.00716.04
5.5.350.0170.02518.16
5.5.340.0180.02817.05
5.5.330.0140.04618.24
5.5.320.0250.03018.12
5.5.310.0280.03518.16
5.5.300.0100.03417.09
5.5.290.0130.05117.05
5.5.280.0150.02318.34
5.5.270.0150.04418.53
5.5.260.0230.04418.33
5.5.250.0200.03818.34
5.5.240.0180.04518.10
5.5.230.0170.01315.75
5.5.220.0210.01415.77
5.5.210.0190.01015.83
5.5.200.0220.00815.84
5.5.190.0220.00915.78
5.5.180.0320.00015.93
5.5.170.0180.01115.89
5.5.160.0280.00815.94
5.5.150.0160.01615.86
5.5.140.0210.01516.02
5.5.130.0210.01215.68
5.5.120.0130.01915.94
5.5.110.0260.01315.79
5.5.100.0240.00915.73
5.5.90.0130.01715.61
5.5.80.0180.01415.79
5.5.70.0170.01315.89
5.5.60.0140.01415.98
5.5.50.0220.01615.82
5.5.40.0150.01515.71
5.5.30.0180.01416.07
5.5.20.0210.01515.80
5.5.10.0200.01815.70
5.5.00.0190.01415.80
5.4.450.0100.03715.88
5.4.440.0080.03216.04
5.4.430.0060.02616.02
5.4.420.0150.01916.16
5.4.410.0120.04215.72
5.4.400.0070.02515.77
5.4.390.0100.03315.84
5.4.380.0100.02915.92
5.4.370.0080.03915.90
5.4.360.0070.03715.84
5.4.350.0080.03315.74
5.4.340.0150.04515.78
5.4.330.0150.01112.47
5.4.320.0120.03215.82
5.4.310.0170.03915.85
5.4.300.0070.02515.85
5.4.290.0080.03115.76
5.4.280.0110.03715.88
5.4.270.0160.03715.90
5.4.260.0100.03915.87
5.4.250.0100.03615.87
5.4.240.0140.03315.65
5.4.230.0130.03415.76
5.4.220.0110.03315.86
5.4.210.0110.02315.60
5.4.200.0100.03615.88
5.4.190.0160.03415.72
5.4.180.0140.04015.70
5.4.170.0160.03815.92
5.4.160.0180.03715.77
5.4.150.0140.04215.92
5.4.140.0120.04014.57
5.4.130.0150.03814.45
5.4.120.0150.03814.56
5.4.110.0140.02814.54
5.4.100.0170.03514.46
5.4.90.0100.02814.48
5.4.80.0150.02614.47
5.4.70.0110.04314.49
5.4.60.0110.03914.55
5.4.50.0110.03714.50
5.4.40.0080.03814.44
5.4.30.0100.04114.39
5.4.20.0060.04314.48
5.4.10.0120.02014.48
5.4.00.0120.03614.19
5.3.290.0100.04513.95
5.3.280.0140.02313.91
5.3.270.0110.03613.90
5.3.260.0120.04713.88
5.3.250.0130.02613.97
5.3.240.0170.04013.85
5.3.230.0120.04813.91
5.3.220.0130.04413.84
5.3.210.0090.02813.80
5.3.200.0160.04013.87
5.3.190.0130.04613.81
5.3.180.0080.05213.95
5.3.170.0090.04313.95
5.3.160.0120.04013.90
5.3.150.0070.03913.92
5.3.140.0100.03113.87
5.3.130.0120.02513.97
5.3.120.0130.02613.96
5.3.110.0080.02713.97
5.3.100.0090.02613.60
5.3.90.0130.03813.73
5.3.80.0110.04513.51
5.3.70.0120.03913.56
5.3.60.0070.03613.64
5.3.50.0130.04413.54
5.3.40.0110.04113.55
5.3.30.0130.01913.58
5.3.20.0170.02413.31
5.3.10.0060.02613.26
5.3.00.0120.03213.24
5.2.170.0080.03111.75
5.2.160.0070.03811.61
5.2.150.0090.01911.67
5.2.140.0130.02511.59
5.2.130.0100.02211.78
5.2.120.0090.02211.71
5.2.110.0150.03511.78
5.2.100.0060.02711.77
5.2.90.0060.03911.67
5.2.80.0100.02311.56
5.2.70.0080.03611.61
5.2.60.0070.02811.66
5.2.50.0160.03211.72
5.2.40.0140.02211.58
5.2.30.0070.02211.50
5.2.20.0090.02111.57
5.2.10.0090.02011.49
5.2.00.0070.01911.46
5.1.60.0020.01911.01
5.1.50.0060.01611.06
5.1.40.0100.01410.97
5.1.30.0070.01811.19
5.1.20.0080.01511.19
5.1.10.0060.02011.07
5.1.00.0090.01711.04
5.0.50.0100.01210.33
5.0.40.0110.01110.22
5.0.30.0040.02110.15
5.0.20.0040.01610.12
5.0.10.0000.01910.12
5.0.00.0060.03110.09
4.4.90.0060.0179.84
4.4.80.0000.0219.84
4.4.70.0060.0089.84
4.4.60.0060.0079.84
4.4.50.0040.0089.84
4.4.40.0000.0189.84
4.4.30.0050.0089.84
4.4.20.0060.0109.84
4.4.10.0050.0109.84
4.4.00.0020.0149.84
4.3.110.0070.0079.84
4.3.100.0030.0099.84
4.3.90.0050.0129.84
4.3.80.0060.0119.84
4.3.70.0020.0099.84
4.3.60.0050.0079.84
4.3.50.0030.0119.84
4.3.40.0040.0189.84
4.3.30.0030.0119.84
4.3.20.0010.0149.84
4.3.10.0040.0089.84
4.3.00.0020.0109.84

preferences:
49.36 ms | 401 KiB | 5 Q