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.0140.00016.63
8.3.50.0100.00916.29
8.3.40.0130.01018.89
8.3.30.0140.00718.68
8.3.20.0000.00818.77
8.3.10.0060.00320.71
8.3.00.0030.00519.25
8.2.180.0140.00418.29
8.2.170.0060.00922.96
8.2.160.0170.00020.93
8.2.150.0000.00824.18
8.2.140.0040.01124.66
8.2.130.0070.01026.16
8.2.120.0100.01019.36
8.2.110.0100.00021.18
8.2.100.0040.00717.84
8.2.90.0070.00320.96
8.2.80.0050.00317.93
8.2.70.0050.00317.75
8.2.60.0080.00018.05
8.2.50.0040.00418.07
8.2.40.0000.00918.09
8.2.30.0070.00018.06
8.2.20.0000.00717.79
8.2.10.0000.00817.65
8.2.00.0000.00917.70
8.1.270.0060.00324.66
8.1.260.0090.00926.35
8.1.250.0040.00428.09
8.1.240.0050.00520.81
8.1.230.0060.00620.93
8.1.220.0000.00817.74
8.1.210.0060.00318.90
8.1.200.0030.00617.23
8.1.190.0040.00417.40
8.1.180.0060.00318.10
8.1.170.0000.00818.84
8.1.160.0040.00418.86
8.1.150.0050.00218.49
8.1.140.0030.00617.32
8.1.130.0000.00717.73
8.1.120.0000.00717.38
8.1.110.0030.00517.43
8.1.100.0030.00617.46
8.1.90.0000.00717.33
8.1.80.0080.00017.32
8.1.70.0000.00717.45
8.1.60.0000.01117.54
8.1.50.0050.00317.40
8.1.40.0060.00317.46
8.1.30.0030.00517.68
8.1.20.0070.00017.64
8.1.10.0030.00617.60
8.1.00.0040.00417.45
8.0.300.0090.00020.02
8.0.290.0060.00316.88
8.0.280.0040.00418.47
8.0.270.0050.00317.29
8.0.260.0070.00016.92
8.0.250.0000.00716.92
8.0.240.0050.00317.02
8.0.230.0070.00017.00
8.0.220.0070.00016.96
8.0.210.0000.00816.95
8.0.200.0000.00717.02
8.0.190.0030.00616.88
8.0.180.0000.00717.00
8.0.170.0000.01016.98
8.0.160.0030.00316.84
8.0.150.0030.00616.89
8.0.140.0030.00816.90
8.0.130.0000.00613.35
8.0.120.0070.00317.00
8.0.110.0090.00017.09
8.0.100.0030.00616.93
8.0.90.0030.00616.95
8.0.80.0100.00717.03
8.0.70.0030.00616.93
8.0.60.0060.00317.09
8.0.50.0000.00817.02
8.0.30.0090.01217.29
8.0.20.0110.01017.20
8.0.10.0030.00617.23
8.0.00.0150.00716.95
7.4.330.0050.00013.00
7.4.320.0030.00616.55
7.4.300.0040.00416.54
7.4.290.0040.00416.37
7.4.280.0040.00416.45
7.4.270.0030.00316.34
7.4.260.0000.00513.20
7.4.250.0060.00316.48
7.4.240.0040.00416.73
7.4.230.0030.00516.47
7.4.220.0100.01016.68
7.4.210.0080.01116.69
7.4.200.0000.00816.52
7.4.190.0040.00416.73
7.4.160.0040.01416.64
7.4.150.0230.00716.67
7.4.140.0110.00816.67
7.4.130.0100.00916.67
7.4.120.0100.01016.72
7.4.110.0130.00616.86
7.4.100.0130.00616.77
7.4.90.0160.01016.70
7.4.80.0110.01219.39
7.4.70.0170.01216.65
7.4.60.0160.01616.69
7.4.50.0200.00716.59
7.4.40.0150.00916.69
7.4.30.0230.01416.66
7.4.20.0190.01016.43
7.4.10.0170.01015.72
7.4.00.0040.01715.61
7.3.330.0030.00313.04
7.3.320.0060.00013.00
7.3.310.0030.00516.32
7.3.300.0030.00616.22
7.3.290.0080.00816.38
7.3.280.0090.01316.37
7.3.270.0040.01516.71
7.3.260.0140.00716.46
7.3.250.0070.01616.41
7.3.240.0090.00916.51
7.3.230.0110.00816.60
7.3.210.0060.01316.41
7.3.200.0090.00916.41
7.3.190.0220.01416.35
7.3.180.0160.01716.56
7.3.170.0170.01616.45
7.3.160.0210.00816.39
7.3.150.0220.01616.39
7.3.140.0150.01516.54
7.3.130.0120.01315.48
7.3.120.0130.01015.42
7.3.110.0140.01115.65
7.3.100.0140.00815.57
7.3.90.0070.01915.60
7.3.80.0110.01215.77
7.3.70.0120.00715.57
7.3.60.0040.01815.52
7.3.50.0100.01115.43
7.3.40.0120.00915.73
7.3.30.0130.00915.49
7.3.20.0190.00716.41
7.3.10.0150.01116.50
7.3.00.0140.01016.39
7.2.330.0130.00616.45
7.2.320.0130.01116.89
7.2.310.0210.01416.59
7.2.300.0230.00916.74
7.2.290.0150.01516.69
7.2.280.0220.01716.40
7.2.270.0220.01116.39
7.2.260.0070.02015.82
7.2.250.0130.01415.70
7.2.240.0150.00915.68
7.2.230.0130.00715.78
7.2.220.0140.01315.70
7.2.210.0160.01015.55
7.2.200.0110.01315.52
7.2.190.0100.01315.74
7.2.180.0150.00615.70
7.2.170.0120.01115.80
7.2.160.0090.01615.70
7.2.150.0140.01016.65
7.2.140.0170.01016.81
7.2.130.0120.01016.62
7.2.120.0120.01116.78
7.2.110.0080.01516.88
7.2.100.0150.00616.68
7.2.90.0080.01316.76
7.2.80.0100.00916.65
7.2.70.0100.00916.77
7.2.60.0090.01016.77
7.2.50.0100.00916.73
7.2.40.0120.00616.68
7.2.30.0100.00916.69
7.2.20.0070.01116.56
7.2.10.0120.00516.73
7.2.00.0100.00816.55
7.1.330.0130.01215.76
7.1.320.0190.00815.79
7.1.310.0110.01015.79
7.1.300.0130.00815.82
7.1.290.0220.00715.64
7.1.280.0140.00615.69
7.1.270.0130.00815.91
7.1.260.0110.01315.75
7.1.250.0060.01615.73
7.1.240.0150.00715.75
7.1.230.0170.00815.65
7.1.220.0100.01215.55
7.1.210.0170.00515.79
7.1.200.0160.00815.79
7.1.190.0120.00915.74
7.1.180.0100.01315.75
7.1.170.0120.01015.87
7.1.160.0160.00815.85
7.1.150.0130.00815.61
7.1.140.0080.01115.74
7.1.130.0090.01215.56
7.1.120.0100.01115.60
7.1.110.0100.01215.61
7.1.100.0130.01115.68
7.1.90.0140.00715.72
7.1.80.0150.00715.69
7.1.70.0080.01016.03
7.1.60.0100.01516.97
7.1.50.0140.01216.23
7.1.40.0080.01415.74
7.1.30.0160.00715.62
7.1.20.0170.00615.57
7.1.10.0160.00715.81
7.1.00.0110.01718.13
7.0.330.0130.01015.52
7.0.320.0170.00615.46
7.0.310.0130.01115.36
7.0.300.0120.01015.44
7.0.290.0160.00815.49
7.0.280.0120.01115.26
7.0.270.0110.00815.39
7.0.260.0220.01015.31
7.0.250.0100.00915.48
7.0.240.0110.01015.37
7.0.230.0100.01315.22
7.0.220.0140.00615.31
7.0.210.0120.00815.44
7.0.200.0100.00915.84
7.0.190.0120.00915.45
7.0.180.0130.00615.55
7.0.170.0090.01215.55
7.0.160.0100.01115.48
7.0.150.0170.00915.53
7.0.140.0190.02917.71
7.0.130.0130.00815.36
7.0.120.0080.03017.68
7.0.110.0130.01115.53
7.0.100.0180.00915.39
7.0.90.0190.00515.60
7.0.80.0080.01515.40
7.0.70.0170.00615.48
7.0.60.0100.03317.51
7.0.50.0140.03416.33
7.0.40.0120.02016.42
7.0.30.0180.03116.35
7.0.20.0190.02516.39
7.0.10.0140.02716.25
7.0.00.0120.03616.42
5.6.400.0150.00915.25
5.6.390.0110.01415.44
5.6.380.0110.00915.02
5.6.370.0110.00914.97
5.6.360.0170.00715.23
5.6.350.0100.01215.14
5.6.340.0100.01215.27
5.6.330.0120.01015.16
5.6.320.0100.01015.05
5.6.310.0130.01315.08
5.6.300.0130.01015.11
5.6.290.0140.00915.28
5.6.280.0140.02917.08
5.6.270.0170.00915.25
5.6.260.0140.01015.23
5.6.250.0090.01515.34
5.6.240.0120.01315.13
5.6.230.0080.01315.23
5.6.220.0120.01215.27
5.6.210.0140.03217.06
5.6.200.0120.03316.25
5.6.190.0120.03417.00
5.6.180.0120.02116.93
5.6.170.0230.03016.93
5.6.160.0060.02416.94
5.6.150.0140.03616.23
5.6.140.0110.02116.20
5.6.130.0130.03216.26
5.6.120.0110.02417.12
5.6.110.0130.03117.08
5.6.100.0080.02417.12
5.6.90.0120.03517.03
5.6.80.0080.02016.96
5.6.70.0110.01114.97
5.6.60.0140.01315.10
5.6.50.0140.01115.02
5.6.40.0130.01115.00
5.6.30.0130.01215.01
5.6.20.0140.01214.89
5.6.10.0140.01014.97
5.6.00.0170.00814.97
5.5.380.0120.01215.10
5.5.370.0080.01314.99
5.5.360.0110.01415.41
5.5.350.0120.03716.88
5.5.340.0090.03316.18
5.5.330.0080.02816.96
5.5.320.0180.03216.95
5.5.310.0200.01916.89
5.5.300.0170.01316.19
5.5.290.0130.02016.13
5.5.280.0130.03217.02
5.5.270.0110.01816.97
5.5.260.0080.03817.01
5.5.250.0120.02216.94
5.5.240.0160.02016.79
5.5.230.0140.01214.90
5.5.220.0120.01515.08
5.5.210.0190.00615.05
5.5.200.0150.00715.03
5.5.190.0120.01215.00
5.5.180.0110.01315.03
5.5.170.0120.01015.18
5.5.160.0090.01415.06
5.5.150.0110.01514.95
5.5.140.0150.00715.14
5.5.130.0110.01014.96
5.5.120.0120.01114.95
5.5.110.0130.01315.13
5.5.100.0130.00815.01
5.5.90.0110.01215.05
5.5.80.0120.01214.68
5.5.70.0160.01515.02
5.5.60.0130.00915.12
5.5.50.0120.01315.12
5.5.40.0120.01015.08
5.5.30.0130.00914.89
5.5.20.0150.01114.88
5.5.10.0160.01115.01
5.5.00.0100.01014.79
5.4.450.0130.02914.58
5.4.440.0080.03514.65
5.4.430.0070.02114.63
5.4.420.0110.02714.60
5.4.410.0140.01914.63
5.4.400.0090.02614.52
5.4.390.0080.02414.41
5.4.380.0080.03014.54
5.4.370.0080.02714.47
5.4.360.0080.02314.41
5.4.350.0110.01714.46
5.4.340.0080.01814.38
5.4.330.0140.00612.11
5.4.320.0070.02014.52
5.4.310.0090.02114.38
5.4.300.0050.03214.49
5.4.290.0120.01914.41
5.4.280.0070.01914.42
5.4.270.0110.01614.45
5.4.260.0100.01614.42
5.4.250.0080.01714.55
5.4.240.0030.02014.48
5.4.230.0100.01814.49
5.4.220.0100.02114.48
5.4.210.0130.01214.35
5.4.200.0070.01714.45
5.4.190.0060.01914.49
5.4.180.0070.01614.39
5.4.170.0070.01514.57
5.4.160.0060.01714.40
5.4.150.0070.02014.56
5.4.140.0080.01513.63
5.4.130.0090.01513.55
5.4.120.0070.01613.58
5.4.110.0090.01613.61
5.4.100.0070.01813.59
5.4.90.0120.01713.60
5.4.80.0090.01513.61
5.4.70.0110.02713.57
5.4.60.0110.02113.56
5.4.50.0080.02913.59
5.4.40.0120.02713.59
5.4.30.0070.01913.58
5.4.20.0110.02613.50
5.4.10.0080.01713.60
5.4.00.0060.02913.47
5.3.290.0080.02213.23
5.3.280.0060.02613.21
5.3.270.0100.01513.20
5.3.260.0090.01913.23
5.3.250.0090.02113.21
5.3.240.0050.02013.22
5.3.230.0070.01913.23
5.3.220.0060.01813.18
5.3.210.0060.01913.15
5.3.200.0060.02013.19
5.3.190.0050.02013.24
5.3.180.0110.02013.30
5.3.170.0050.01813.23
5.3.160.0110.02113.18
5.3.150.0120.02013.24
5.3.140.0100.02613.19
5.3.130.0110.03113.20
5.3.120.0100.03113.24
5.3.110.0110.03013.26
5.3.100.0090.03213.03
5.3.90.0070.02112.99
5.3.80.0050.02213.04
5.3.70.0070.02312.98
5.3.60.0100.03213.01
5.3.50.0120.02413.07
5.3.40.0110.02813.01
5.3.30.0120.02812.96
5.3.20.0060.03512.94
5.3.10.0100.02912.88
5.3.00.0060.03112.81
5.2.170.0060.02411.71
5.2.160.0060.03711.71
5.2.150.0110.02511.65
5.2.140.0140.02111.74
5.2.130.0110.03511.65
5.2.120.0070.02811.63
5.2.110.0090.02611.59
5.2.100.0090.01911.67
5.2.90.0080.03711.60
5.2.80.0100.02811.70
5.2.70.0120.03411.64
5.2.60.0070.03111.71
5.2.50.0080.02111.58
5.2.40.0060.02511.62
5.2.30.0090.03011.54
5.2.20.0110.02111.56
5.2.10.0090.01911.53
5.2.00.0040.03911.48
5.1.60.0040.03611.03
5.1.50.0070.01711.04
5.1.40.0050.03311.10
5.1.30.0050.02011.28
5.1.20.0120.02011.22
5.1.10.0080.02711.11
5.1.00.0050.03410.99
5.0.50.0040.02210.28
5.0.40.0070.01210.28
5.0.30.0100.03010.28
5.0.20.0040.02610.28
5.0.10.0100.02210.28
5.0.00.0060.03310.28
4.4.90.0080.01610.28
4.4.80.0040.01010.28
4.4.70.0030.01110.28
4.4.60.0070.01710.28
4.4.50.0060.01310.28
4.4.40.0000.02110.28
4.4.30.0050.00810.28
4.4.20.0050.01310.28
4.4.10.0050.01810.28
4.4.00.0040.02810.28
4.3.110.0020.01510.28
4.3.100.0020.01210.28
4.3.90.0010.02110.28
4.3.80.0030.02610.28
4.3.70.0020.01510.28
4.3.60.0080.01510.28
4.3.50.0040.01710.28
4.3.40.0060.02710.28
4.3.30.0030.00810.28
4.3.20.0020.01310.28
4.3.10.0020.01210.28
4.3.00.0010.01110.28

preferences:
55.32 ms | 400 KiB | 5 Q