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", "ISO-8859-1//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.0170.00316.63
8.3.50.0120.00521.99
8.3.40.0100.01018.70
8.3.30.0030.01518.88
8.3.20.0030.00620.21
8.3.10.0000.00823.45
8.3.00.0000.00720.71
8.2.180.0060.01216.75
8.2.170.0110.00422.96
8.2.160.0090.00618.91
8.2.150.0090.00024.18
8.2.140.0080.00024.66
8.2.130.0060.00326.16
8.2.120.0040.00422.13
8.2.110.0030.00622.25
8.2.100.0080.00417.91
8.2.90.0050.00319.05
8.2.80.0040.00417.97
8.2.70.0030.00517.63
8.2.60.0030.00517.68
8.2.50.0000.00918.07
8.2.40.0000.00819.32
8.2.30.0040.00417.98
8.2.20.0030.00517.81
8.2.10.0040.00417.72
8.2.00.0080.00017.71
8.1.280.0140.00325.92
8.1.270.0080.00023.84
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0100.00023.62
8.1.230.0060.00619.00
8.1.220.0000.00817.79
8.1.210.0060.00318.77
8.1.200.0030.00617.36
8.1.190.0000.00817.52
8.1.180.0000.00818.10
8.1.170.0050.00318.46
8.1.160.0040.00421.96
8.1.150.0000.00718.72
8.1.140.0050.00217.40
8.1.130.0000.00717.86
8.1.120.0070.00017.43
8.1.110.0000.00717.48
8.1.100.0040.00417.53
8.1.90.0070.00017.52
8.1.80.0070.00017.36
8.1.70.0030.00517.41
8.1.60.0060.00317.59
8.1.50.0050.00517.60
8.1.40.0050.00217.59
8.1.30.0040.00417.67
8.1.20.0070.00017.69
8.1.10.0040.00417.43
8.1.00.0040.00417.51
8.0.300.0040.00418.77
8.0.290.0050.00217.18
8.0.280.0000.00718.39
8.0.270.0000.00817.36
8.0.260.0000.00816.82
8.0.250.0000.00716.94
8.0.240.0070.00017.06
8.0.230.0050.00217.07
8.0.220.0000.00717.00
8.0.210.0030.00316.86
8.0.200.0030.00317.09
8.0.190.0040.00416.94
8.0.180.0000.00717.07
8.0.170.0050.00216.89
8.0.160.0050.00316.99
8.0.150.0030.00616.88
8.0.140.0000.00716.96
8.0.130.0000.00513.35
8.0.120.0000.00917.11
8.0.110.0080.00017.02
8.0.100.0060.00317.05
8.0.90.0060.00317.13
8.0.80.0060.01317.08
8.0.70.0030.00617.14
8.0.60.0030.00617.09
8.0.50.0050.00517.18
8.0.30.0100.01117.51
8.0.20.0060.01517.44
8.0.10.0030.00617.33
8.0.00.0110.01117.08
7.4.330.0000.00515.02
7.4.320.0000.00616.56
7.4.300.0000.00616.59
7.4.290.0000.00716.54
7.4.280.0040.00416.62
7.4.270.0030.00316.52
7.4.260.0000.00713.27
7.4.250.0050.00516.69
7.4.240.0030.00616.72
7.4.230.0030.00516.77
7.4.220.0100.01016.82
7.4.210.0090.01116.71
7.4.200.0030.00616.81
7.4.190.0030.00516.88
7.4.160.0130.00716.54
7.4.150.0090.01217.40
7.4.140.0080.01417.86
7.4.130.0090.01616.69
7.4.120.0070.01316.71
7.4.110.0060.01216.65
7.4.100.0190.00616.75
7.4.90.0130.00616.78
7.4.80.0090.02119.39
7.4.70.0180.00516.57
7.4.60.0120.01016.50
7.4.50.0050.01216.52
7.4.40.0120.00719.63
7.4.30.0170.01016.58
7.4.20.0150.00616.76
7.4.10.0110.01116.43
7.4.00.0070.01515.74
7.3.330.0060.00013.18
7.3.320.0050.00013.21
7.3.310.0060.00316.23
7.3.300.0000.00816.40
7.3.290.0000.02116.39
7.3.280.0100.00916.40
7.3.270.0090.00917.40
7.3.260.0090.01516.61
7.3.250.0100.01216.48
7.3.240.0160.00316.43
7.3.230.0140.00516.69
7.3.210.0110.00716.48
7.3.200.0100.01016.45
7.3.190.0100.01516.38
7.3.180.0090.01116.39
7.3.170.0090.01616.23
7.3.160.0140.01116.41
7.3.150.0140.01416.30
7.3.140.0140.00716.36
7.3.130.0200.00716.38
7.3.120.0130.00815.60
7.3.110.0180.01316.18
7.3.100.0190.01215.96
7.3.90.0150.01515.97
7.3.80.0080.01216.61
7.3.70.0100.01016.25
7.3.60.0170.01016.30
7.3.50.0100.01216.17
7.3.40.0100.01116.24
7.3.30.0110.01116.35
7.3.20.0170.01016.01
7.3.10.0080.01916.09
7.3.00.0070.02016.04
7.2.330.0110.01116.79
7.2.320.0090.01516.45
7.2.310.0160.01116.58
7.2.300.0120.01016.57
7.2.290.0170.00616.53
7.2.280.0110.00816.52
7.2.270.0070.01416.55
7.2.260.0120.01416.39
7.2.250.0180.01816.64
7.2.240.0110.01716.35
7.2.230.0130.01516.16
7.2.220.0210.00916.26
7.2.210.0070.01116.43
7.2.200.0070.01416.50
7.2.190.0110.01116.45
7.2.180.0070.01516.48
7.2.170.0070.01416.38
7.2.160.0140.01416.41
7.2.150.0220.00816.26
7.2.140.0070.02116.29
7.2.130.0060.01816.20
7.2.120.0190.01116.25
7.2.110.0090.01516.31
7.2.100.0110.01516.41
7.2.90.0250.00316.20
7.2.80.0190.00916.54
7.2.70.0120.01716.44
7.2.60.0130.01416.71
7.2.50.0170.00816.21
7.2.40.0100.01716.16
7.2.30.0330.01516.29
7.2.20.0240.01716.22
7.2.10.0030.02316.45
7.2.00.0090.01216.28
7.1.330.0210.01315.71
7.1.320.0270.00915.69
7.1.310.0240.00915.73
7.1.300.0310.00315.69
7.1.290.0250.00915.81
7.1.280.0240.01015.65
7.1.270.0340.01115.84
7.1.260.0310.01715.57
7.1.250.0300.01315.62
7.1.240.0230.01415.64
7.1.230.0160.01615.59
7.1.220.0350.01415.50
7.1.210.0250.01915.71
7.1.200.0170.00915.79
7.1.190.0240.01915.73
7.1.180.0260.01515.52
7.1.170.0240.01415.66
7.1.160.0290.01315.59
7.1.150.0300.01415.71
7.1.140.0240.01015.61
7.1.130.0250.00815.65
7.1.120.0120.02015.64
7.1.110.0240.01015.62
7.1.100.0220.01115.45
7.1.90.0190.01115.74
7.1.80.0330.00315.55
7.1.70.0100.01116.41
7.1.60.0150.01817.46
7.1.50.0120.01716.35
7.1.40.0280.00315.84
7.1.30.0330.00015.63
7.1.20.0250.00615.75
7.1.10.0200.01315.80
7.1.00.0130.04519.07
7.0.330.0270.00415.30
7.0.320.0200.02015.53
7.0.310.0160.02115.36
7.0.300.0360.00615.27
7.0.290.0210.01115.43
7.0.280.0180.01815.14
7.0.270.0170.01415.32
7.0.260.0210.01015.56
7.0.250.0270.00915.33
7.0.240.0230.00915.29
7.0.230.0190.01315.38
7.0.220.0260.00915.42
7.0.210.0220.01015.24
7.0.200.0160.00816.20
7.0.190.0260.00415.39
7.0.180.0210.00815.42
7.0.170.0190.01415.49
7.0.160.0410.01515.46
7.0.150.0200.00915.18
7.0.140.0080.04518.70
7.0.130.0220.01115.31
7.0.120.0210.01215.42
7.0.110.0260.01015.31
7.0.100.0180.03317.78
7.0.90.0150.02817.64
7.0.80.0110.02617.74
7.0.70.0100.02517.58
7.0.60.0510.02417.61
7.0.50.0150.02518.01
7.0.40.0160.02317.79
7.0.30.0120.02717.83
7.0.20.0330.03417.78
7.0.10.0130.03517.74
7.0.00.0110.04817.69
5.6.400.0260.01015.95
5.6.390.0260.01215.84
5.6.380.0250.01615.83
5.6.370.0320.01016.00
5.6.360.0190.01916.08
5.6.350.0210.01115.70
5.6.340.0290.00716.02
5.6.330.0230.02016.37
5.6.320.0360.00916.09
5.6.310.0190.01315.73
5.6.300.0200.00916.04
5.6.290.0240.01516.33
5.6.280.0120.04618.45
5.6.270.0180.01816.00
5.6.260.0110.01815.93
5.6.250.0140.02718.39
5.6.240.0070.03618.34
5.6.230.0100.03218.36
5.6.220.0110.02618.34
5.6.210.0130.02518.27
5.6.200.0150.03518.68
5.6.190.0070.03318.67
5.6.180.0090.03318.61
5.6.170.0130.02618.62
5.6.160.0110.04818.54
5.6.150.0100.04618.70
5.6.140.0140.05018.54
5.6.130.0120.05318.63
5.6.120.0120.05018.43
5.6.110.0100.04918.55
5.6.100.0150.05018.57
5.6.90.0140.04318.60
5.6.80.0170.04218.29
5.6.70.0130.03018.31
5.6.60.0180.04218.20
5.6.50.0130.04918.14
5.6.40.0220.05618.26
5.6.30.0190.04218.16
5.6.20.0170.03718.28
5.6.10.0160.04318.32
5.6.00.0150.03818.20
5.5.380.0180.02318.20
5.5.370.0120.02718.16
5.5.360.0140.03418.25
5.5.350.0160.03418.03
5.5.340.0140.02218.51
5.5.330.0130.02218.43
5.5.320.0100.03318.43
5.5.310.0170.03018.54
5.5.300.0120.05018.53
5.5.290.0160.04318.53
5.5.280.0160.04618.38
5.5.270.0150.04518.57
5.5.260.0170.04418.50
5.5.250.0140.04618.41
5.5.240.0160.04318.16
5.5.230.0110.04318.19
5.5.220.0200.02618.09
5.5.210.0240.05418.09
5.5.200.0180.04818.10
5.5.190.0260.05118.19
5.5.180.0120.03518.08
5.5.170.0340.03216.04
5.5.160.0180.04418.27
5.5.150.0150.04518.18
5.5.140.0200.03318.08
5.5.130.0100.04618.03
5.5.120.0090.05318.13
5.5.110.0180.03217.99
5.5.100.0150.05018.13
5.5.90.0100.03818.01
5.5.80.0150.04318.12
5.5.70.0240.04518.04
5.5.60.0150.04418.07
5.5.50.0160.04217.92
5.5.40.0240.03918.01
5.5.30.0180.04718.08
5.5.20.0210.04118.05
5.5.10.0170.04318.01
5.5.00.0160.04618.00
5.4.450.0090.03016.10
5.4.440.0120.04116.13
5.4.430.0180.03516.11
5.4.420.0130.03616.14
5.4.410.0120.04616.11
5.4.400.0130.03815.72
5.4.390.0150.03615.85
5.4.380.0100.03615.81
5.4.370.0290.05215.84
5.4.360.0070.04415.89
5.4.350.0140.04015.74
5.4.340.0150.03815.87
5.4.330.0130.01012.63
5.4.320.0160.04115.71
5.4.310.0140.04115.82
5.4.300.0160.04115.77
5.4.290.0150.02815.81
5.4.280.0100.04515.82
5.4.270.0100.04515.98
5.4.260.0130.02615.87
5.4.250.0090.04115.71
5.4.240.0170.04015.84
5.4.230.0130.04215.74
5.4.220.0140.04215.70
5.4.210.0120.04415.80
5.4.200.0140.02415.78
5.4.190.0180.03115.79
5.4.180.0140.03915.80
5.4.170.0110.04715.70
5.4.160.0140.03415.90
5.4.150.0140.03715.89
5.4.140.0080.03214.47
5.4.130.0050.03014.44
5.4.120.0110.03914.50
5.4.110.0120.04414.45
5.4.100.0100.04014.38
5.4.90.0100.03014.49
5.4.80.0160.03514.54
5.4.70.0050.04714.43
5.4.60.0070.04314.59
5.4.50.0120.04114.49
5.4.40.0120.04014.51
5.4.30.0110.03714.56
5.4.20.0120.02914.46
5.4.10.0230.03414.46
5.4.00.0130.03814.18
5.3.290.0150.04513.96
5.3.280.0120.04313.88
5.3.270.0170.04213.91
5.3.260.0130.04813.92
5.3.250.0120.03913.85
5.3.240.0070.04913.89
5.3.230.0130.03813.93
5.3.220.0150.04313.97
5.3.210.0120.04313.77
5.3.200.0090.04813.81
5.3.190.0140.02413.87
5.3.180.0160.04013.99
5.3.170.0120.04213.90
5.3.160.0100.03513.95
5.3.150.0110.04513.88
5.3.140.0080.05013.83
5.3.130.0110.04713.86
5.3.120.0110.04113.86
5.3.110.0110.04813.95
5.3.100.0100.03113.70
5.3.90.0110.04113.77
5.3.80.0150.03413.61
5.3.70.0180.03513.58
5.3.60.0230.03513.63
5.3.50.0140.03813.57
5.3.40.0100.04113.55
5.3.30.0120.04113.54
5.3.20.0100.04313.40
5.3.10.0140.03913.44
5.3.00.0120.04613.26
5.2.170.0120.03311.75
5.2.160.0090.03611.72
5.2.150.0120.03211.80
5.2.140.0090.04211.71
5.2.130.0070.03911.74
5.2.120.0060.03011.63
5.2.110.0090.03911.60
5.2.100.0150.03311.81
5.2.90.0090.03611.64
5.2.80.0140.02911.76
5.2.70.0070.03611.62
5.2.60.0110.03311.56
5.2.50.0070.03911.55
5.2.40.0090.03611.49
5.2.30.0080.03511.57
5.2.20.0050.04111.60
5.2.10.0110.02811.48
5.2.00.0130.03111.44
5.1.60.0050.03610.97
5.1.50.0060.03411.07
5.1.40.0080.03110.94
5.1.30.0130.02811.17
5.1.20.0090.02211.24
5.1.10.0100.03011.12
5.1.00.0030.03611.11
5.0.50.0090.02610.23
5.0.40.0130.01010.23
5.0.30.0060.03710.17
5.0.20.0120.03810.16
5.0.10.0050.02210.16
5.0.00.0090.03710.14
4.4.90.0060.0139.93
4.4.80.0060.0189.93
4.4.70.0080.0169.93
4.4.60.0060.0179.93
4.4.50.0040.0199.93
4.4.40.0050.0319.93
4.4.30.0090.0149.93
4.4.20.0040.0199.93
4.4.10.0060.0129.93
4.4.00.0040.0299.93
4.3.110.0050.0169.93
4.3.100.0040.0139.93
4.3.90.0080.0159.93
4.3.80.0090.0119.93
4.3.70.0050.0189.93
4.3.60.0060.0179.93
4.3.50.0050.0189.93
4.3.40.0050.0289.93
4.3.30.0040.0229.93
4.3.20.0060.0129.93
4.3.10.0030.0209.93
4.3.00.0030.0209.93

preferences:
50.77 ms | 401 KiB | 5 Q