3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = "\xC2°Freen\x18 ew°\x90ɮ\x7F\xA0 \xc2blabla"; //$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.0150.00016.75
8.3.50.0150.00717.21
8.3.40.0140.00018.68
8.3.30.0070.00718.85
8.3.20.0040.00418.50
8.3.10.0050.00320.53
8.3.00.0000.00817.50
8.2.180.0140.00316.75
8.2.170.0150.00022.96
8.2.160.0070.00722.11
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00019.83
8.2.110.0060.00322.24
8.2.100.0060.00619.57
8.2.90.0050.00319.04
8.2.80.0040.00418.92
8.2.70.0080.00017.63
8.2.60.0030.00517.75
8.2.50.0050.00517.75
8.2.40.0080.00018.16
8.2.30.0070.00018.13
8.2.20.0050.00317.63
8.2.10.0000.00717.90
8.2.00.0000.00817.72
8.1.280.0080.00825.92
8.1.270.0000.00824.66
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0060.00323.78
8.1.230.0040.00820.85
8.1.220.0040.00418.60
8.1.210.0060.00318.77
8.1.200.0030.00517.47
8.1.190.0030.00517.38
8.1.180.0040.00418.10
8.1.170.0030.00618.73
8.1.160.0000.00718.92
8.1.150.0000.00718.59
8.1.140.0000.00817.54
8.1.130.0040.00417.78
8.1.120.0030.00417.48
8.1.110.0000.00717.34
8.1.100.0040.00417.38
8.1.90.0000.00817.51
8.1.80.0030.00317.40
8.1.70.0000.00817.43
8.1.60.0030.00617.58
8.1.50.0000.00717.40
8.1.40.0030.00617.45
8.1.30.0030.00517.57
8.1.20.0040.00417.69
8.1.10.0050.00217.55
8.1.00.0040.00417.49
8.0.300.0000.00818.77
8.0.290.0040.00416.88
8.0.280.0000.00718.47
8.0.270.0000.00717.29
8.0.260.0030.00316.93
8.0.250.0050.00217.05
8.0.240.0000.00717.01
8.0.230.0070.00017.07
8.0.220.0020.00516.90
8.0.210.0070.00016.92
8.0.200.0060.00017.00
8.0.190.0040.00417.07
8.0.180.0040.00417.02
8.0.170.0060.00317.00
8.0.160.0050.00317.02
8.0.150.0080.00016.94
8.0.140.0000.01016.85
8.0.130.0000.00513.46
8.0.120.0030.00617.09
8.0.110.0030.00617.01
8.0.100.0030.00617.00
8.0.90.0000.00917.02
8.0.80.0070.01017.05
8.0.70.0060.00316.95
8.0.60.0030.00617.04
8.0.50.0060.00317.19
8.0.30.0150.00717.16
8.0.20.0100.01217.35
8.0.10.0090.00017.30
8.0.00.0080.01216.92
7.4.330.0000.00413.02
7.4.320.0000.00716.54
7.4.300.0000.00616.52
7.4.290.0000.00716.52
7.4.280.0060.00316.64
7.4.270.0050.00316.65
7.4.260.0040.00413.32
7.4.250.0100.00016.70
7.4.240.0040.00416.63
7.4.230.0040.00416.59
7.4.220.0060.01316.71
7.4.210.0070.00916.72
7.4.200.0040.00416.62
7.4.190.0000.00816.86
7.4.160.0070.01016.57
7.4.150.0110.01016.68
7.4.140.0100.01116.70
7.4.130.0140.00716.74
7.4.120.0080.01016.74
7.4.110.0120.01216.70
7.4.100.0060.01316.74
7.4.90.0080.01216.63
7.4.80.0120.01219.39
7.4.70.0100.01016.50
7.4.60.0080.00816.79
7.4.50.0080.00916.69
7.4.40.0090.00916.69
7.4.30.0040.02416.60
7.4.20.0100.01016.63
7.4.10.0070.01216.78
7.4.00.0100.00915.87
7.3.330.0000.00613.26
7.3.320.0000.00513.16
7.3.310.0030.00616.35
7.3.300.0040.00416.40
7.3.290.0100.01016.27
7.3.280.0070.01216.38
7.3.270.0120.00916.48
7.3.260.0080.01016.36
7.3.250.0140.00616.35
7.3.240.0060.01216.59
7.3.230.0090.00916.42
7.3.210.0120.01216.34
7.3.200.0080.01016.70
7.3.190.0100.01116.58
7.3.180.0050.01516.54
7.3.170.0110.00916.42
7.3.160.0090.01216.39
7.3.150.0120.00816.61
7.3.140.0110.01116.26
7.3.130.0100.01616.55
7.3.120.0100.01015.87
7.3.110.0100.01316.37
7.3.100.0070.01116.59
7.3.90.0000.02216.36
7.3.80.0110.00816.39
7.3.70.0080.01416.31
7.3.60.0080.01216.53
7.3.50.0110.01416.52
7.3.40.0100.01016.42
7.3.30.0100.01016.52
7.3.20.0190.00816.50
7.3.10.0040.01416.60
7.3.00.0110.00916.64
7.2.330.0120.01216.46
7.2.320.0030.01616.66
7.2.310.0110.01416.66
7.2.300.0120.00716.61
7.2.290.0110.01316.67
7.2.280.0150.00916.61
7.2.270.0090.01216.70
7.2.260.0130.00816.71
7.2.250.0120.01216.69
7.2.240.0080.01316.69
7.2.230.0070.01616.62
7.2.220.0030.01616.45
7.2.210.0080.02216.62
7.2.200.0190.00816.63
7.2.190.0070.01316.44
7.2.180.0060.01216.52
7.2.170.0030.01816.68
7.2.160.0130.01016.58
7.2.150.0090.01516.63
7.2.140.0150.00916.56
7.2.130.0070.00916.72
7.2.120.0090.01216.88
7.2.110.0150.01016.80
7.2.100.0100.01316.75
7.2.90.0100.01416.86
7.2.80.0110.00816.80
7.2.70.0100.00916.87
7.2.60.0100.00916.89
7.2.50.0060.01516.85
7.2.40.0090.01116.82
7.2.30.0080.00816.98
7.2.20.0110.00716.83
7.2.10.0100.01116.82
7.2.00.0070.01017.42
7.1.330.0300.00615.78
7.1.320.0210.01815.79
7.1.310.0350.00715.62
7.1.300.0250.00515.56
7.1.290.0210.00915.83
7.1.280.0250.01215.54
7.1.270.0220.01215.87
7.1.260.0410.01215.56
7.1.250.0140.00915.84
7.1.240.0280.01215.45
7.1.230.0290.00715.59
7.1.220.0190.01415.56
7.1.210.0200.01215.54
7.1.200.0230.01315.41
7.1.190.0260.00715.54
7.1.180.0290.01115.61
7.1.170.0230.01715.63
7.1.160.0220.01315.59
7.1.150.0170.01715.57
7.1.140.0300.00915.60
7.1.130.0240.01615.57
7.1.120.0240.00615.58
7.1.110.0210.00915.66
7.1.100.0220.00416.81
7.1.90.0160.01715.61
7.1.80.0220.00815.70
7.1.70.0130.01216.40
7.1.60.0160.01617.56
7.1.50.0090.01816.18
7.1.40.0570.00915.53
7.1.30.0170.01215.60
7.1.20.0290.00215.65
7.1.10.0180.01215.57
7.1.00.0090.04619.01
7.0.330.0240.00815.23
7.0.320.0220.01115.42
7.0.310.0260.01215.30
7.0.300.0620.01315.35
7.0.290.0220.00615.35
7.0.280.0460.01215.31
7.0.270.0150.01815.20
7.0.260.0220.00615.41
7.0.250.0200.01015.35
7.0.240.0230.01315.30
7.0.230.0260.01315.23
7.0.220.0280.01215.29
7.0.210.0230.00715.21
7.0.200.0510.01315.12
7.0.190.0240.00815.45
7.0.180.0270.00315.36
7.0.170.0200.01315.25
7.0.160.0210.01215.29
7.0.150.0250.00315.31
7.0.140.0140.04518.78
7.0.130.0150.01515.45
7.0.120.0170.03218.74
7.0.110.0190.01015.36
7.0.100.0280.01415.50
7.0.90.0130.01415.26
7.0.80.0200.00815.27
7.0.70.0210.01515.25
7.0.60.0170.03818.40
7.0.50.0110.05116.63
7.0.40.0110.02817.66
7.0.30.0420.04817.82
7.0.20.0230.04917.87
7.0.10.0160.04717.82
7.0.00.0120.04717.78
5.6.400.0230.01016.07
5.6.390.0160.02015.81
5.6.380.0180.01516.17
5.6.370.0210.01316.14
5.6.360.0260.00616.11
5.6.350.0200.01216.03
5.6.340.0230.01015.74
5.6.330.0230.01216.06
5.6.320.0160.02215.73
5.6.310.0240.00716.16
5.6.300.0170.01616.06
5.6.290.0240.00915.89
5.6.280.0110.04318.69
5.6.270.0230.00816.27
5.6.260.0250.01416.08
5.6.250.0210.01316.17
5.6.240.0180.01115.81
5.6.230.0130.02016.19
5.6.220.0260.01115.77
5.6.210.0110.04818.27
5.6.200.0170.03717.27
5.6.190.0090.03618.27
5.6.180.0170.04918.26
5.6.170.0260.04518.36
5.6.160.0160.04618.36
5.6.150.0160.04417.14
5.6.140.0120.05417.20
5.6.130.0140.04717.19
5.6.120.0190.02818.54
5.6.110.0110.02818.55
5.6.100.0170.05018.57
5.6.90.0150.05018.50
5.6.80.0160.04618.27
5.6.70.0180.01815.84
5.6.60.0230.01315.91
5.6.50.0220.00815.90
5.6.40.0200.01516.00
5.6.30.0240.01015.98
5.6.20.0180.01115.77
5.6.10.0130.02615.77
5.6.00.0180.01515.98
5.5.380.0250.00815.98
5.5.370.0210.00915.89
5.5.360.0190.01315.96
5.5.350.0190.04818.15
5.5.340.0120.05517.06
5.5.330.0160.03818.35
5.5.320.0180.04018.12
5.5.310.0290.04418.35
5.5.300.0160.04617.13
5.5.290.0120.02917.07
5.5.280.0150.04818.43
5.5.270.0160.03618.44
5.5.260.0140.02718.46
5.5.250.0100.03318.28
5.5.240.0210.01918.02
5.5.230.0120.02415.92
5.5.220.0190.01715.75
5.5.210.0190.01216.11
5.5.200.0170.01315.88
5.5.190.0220.01315.83
5.5.180.0170.01415.90
5.5.170.0200.01216.05
5.5.160.0240.00915.89
5.5.150.0120.02015.99
5.5.140.0220.01615.93
5.5.130.0240.00715.91
5.5.120.0200.01215.76
5.5.110.0160.02215.88
5.5.100.0210.01516.02
5.5.90.0230.00915.83
5.5.80.0260.00415.88
5.5.70.0120.01715.74
5.5.60.0200.01615.96
5.5.50.0250.00915.88
5.5.40.0140.01415.87
5.5.30.0140.02015.72
5.5.20.0190.01615.75
5.5.10.0280.00415.84
5.5.00.0210.01115.72
5.4.450.0160.02715.87
5.4.440.0130.03316.00
5.4.430.0100.03916.09
5.4.420.0100.02415.81
5.4.410.0090.04416.12
5.4.400.0130.03015.95
5.4.390.0150.03815.92
5.4.380.0140.04115.79
5.4.370.0160.03215.84
5.4.360.0130.03515.77
5.4.350.0100.04415.84
5.4.340.0140.02615.90
5.4.330.0200.00712.43
5.4.320.0110.03215.82
5.4.310.0080.03815.77
5.4.300.0100.03615.67
5.4.290.0070.03415.80
5.4.280.0150.03015.67
5.4.270.0080.05115.85
5.4.260.0190.03215.82
5.4.250.0120.05015.66
5.4.240.0070.02715.74
5.4.230.0110.02815.89
5.4.220.0110.02915.77
5.4.210.0080.04615.79
5.4.200.0090.03715.87
5.4.190.0050.04915.80
5.4.180.0110.04415.67
5.4.170.0110.02215.82
5.4.160.0140.02015.82
5.4.150.0110.02515.72
5.4.140.0130.01814.51
5.4.130.0130.01814.47
5.4.120.0100.02114.42
5.4.110.0100.02414.47
5.4.100.0140.01814.37
5.4.90.0100.02214.44
5.4.80.0020.02814.40
5.4.70.0100.02014.60
5.4.60.0130.01814.43
5.4.50.0090.02214.53
5.4.40.0140.02314.44
5.4.30.0110.02014.49
5.4.20.0070.02314.41
5.4.10.0100.02314.47
5.4.00.0140.01714.27
5.3.290.0100.02913.93
5.3.280.0090.04413.86
5.3.270.0130.03713.86
5.3.260.0120.02213.93
5.3.250.0140.02113.83
5.3.240.0150.02013.76
5.3.230.0170.01913.92
5.3.220.0080.02613.83
5.3.210.0120.02513.89
5.3.200.0090.02313.93
5.3.190.0110.02413.86
5.3.180.0100.02413.98
5.3.170.0100.02314.04
5.3.160.0110.02413.81
5.3.150.0100.02513.87
5.3.140.0100.02713.84
5.3.130.0100.02414.00
5.3.120.0100.02613.99
5.3.110.0110.02313.91
5.3.100.0130.02413.58
5.3.90.0130.02213.71
5.3.80.0120.02213.49
5.3.70.0110.02213.53
5.3.60.0120.02213.49
5.3.50.0130.02213.65
5.3.40.0080.02513.53
5.3.30.0100.02213.55
5.3.20.0140.02013.36
5.3.10.0080.02613.39
5.3.00.0070.02813.26
5.2.170.0100.02011.68
5.2.160.0050.02211.66
5.2.150.0090.01911.76
5.2.140.0090.01811.71
5.2.130.0080.01711.66
5.2.120.0030.02711.70
5.2.110.0050.02111.67
5.2.100.0050.02311.63
5.2.90.0060.02011.69
5.2.80.0100.02111.64
5.2.70.0050.02211.75
5.2.60.0100.01711.65
5.2.50.0040.02111.69
5.2.40.0090.01711.67
5.2.30.0070.01811.52
5.2.20.0050.02011.53
5.2.10.0100.02611.50
5.2.00.0080.03111.43
5.1.60.0030.01810.98
5.1.50.0040.03511.01
5.1.40.0060.02011.04
5.1.30.0060.02011.20
5.1.20.0040.02111.23
5.1.10.0070.02811.06
5.1.00.0060.03011.14
5.0.50.0040.01610.29
5.0.40.0020.02010.26
5.0.30.0080.02310.13
5.0.20.0030.02010.15
5.0.10.0060.02010.11
5.0.00.0030.02410.14
4.4.90.0030.0109.89
4.4.80.0060.0089.89
4.4.70.0020.0119.89
4.4.60.0020.0109.89
4.4.50.0020.0109.89
4.4.40.0020.0279.89
4.4.30.0020.0219.89
4.4.20.0010.0219.89
4.4.10.0010.0109.89
4.4.00.0010.0269.89
4.3.110.0050.0139.89
4.3.100.0030.0189.89
4.3.90.0030.0199.89
4.3.80.0010.0319.89
4.3.70.0010.0149.89
4.3.60.0050.0179.89
4.3.50.0000.0149.89
4.3.40.0000.0199.89
4.3.30.0030.0179.89
4.3.20.0000.0139.89
4.3.10.0030.0109.89
4.3.00.0000.0219.89

preferences:
40.61 ms | 400 KiB | 5 Q