3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = "\xC2°Freen\x18 ew°\x90ɮ\x7F\xA0\xC2 \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.0120.00616.63
8.3.50.0150.00621.93
8.3.40.0070.00718.97
8.3.30.0000.01418.96
8.3.20.0050.00320.30
8.3.10.0080.00023.48
8.3.00.0050.00321.02
8.2.180.0120.00918.41
8.2.170.0000.01522.96
8.2.160.0100.00320.38
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0180.00026.16
8.2.120.0000.00722.29
8.2.110.0050.00520.43
8.2.100.0090.00617.60
8.2.90.0040.00419.22
8.2.80.0040.00417.97
8.2.70.0080.00017.50
8.2.60.0040.00418.05
8.2.50.0080.00018.07
8.2.40.0000.00818.16
8.2.30.0000.00818.09
8.2.20.0000.00717.74
8.2.10.0000.00717.73
8.2.00.0040.00417.94
8.1.280.0140.00025.92
8.1.270.0030.00523.79
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0050.00523.66
8.1.230.0080.00321.08
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0000.00817.35
8.1.190.0000.00817.52
8.1.180.0030.00618.10
8.1.170.0070.00318.56
8.1.160.0000.00821.96
8.1.150.0000.00718.65
8.1.140.0040.00417.49
8.1.130.0040.00417.74
8.1.120.0030.00517.51
8.1.110.0000.00717.48
8.1.100.0000.00717.55
8.1.90.0040.00417.41
8.1.80.0040.00417.50
8.1.70.0030.00317.38
8.1.60.0030.00517.52
8.1.50.0050.00317.49
8.1.40.0080.00017.47
8.1.30.0030.00617.53
8.1.20.0030.00617.67
8.1.10.0050.00317.53
8.1.00.0050.00217.46
8.0.300.0040.00418.77
8.0.290.0080.00017.15
8.0.280.0040.00418.48
8.0.270.0050.00217.29
8.0.260.0000.00616.98
8.0.250.0000.00817.06
8.0.240.0000.00716.93
8.0.230.0030.00317.10
8.0.220.0000.00717.03
8.0.210.0030.00616.97
8.0.200.0080.00016.96
8.0.190.0050.00417.02
8.0.180.0070.00016.99
8.0.170.0030.00317.07
8.0.160.0050.00316.91
8.0.150.0040.00416.90
8.0.140.0040.00416.92
8.0.130.0050.00013.49
8.0.120.0000.00917.00
8.0.110.0040.00417.13
8.0.100.0030.00617.14
8.0.90.0030.00617.04
8.0.80.0140.01017.04
8.0.70.0000.00917.25
8.0.60.0030.00617.24
8.0.50.0000.00917.03
8.0.30.0130.00817.28
8.0.20.0070.01317.41
8.0.10.0060.00317.32
8.0.00.0130.01016.86
7.4.330.0000.00515.01
7.4.320.0060.00016.59
7.4.300.0050.00316.44
7.4.290.0000.00716.66
7.4.280.0000.00816.52
7.4.270.0000.00716.64
7.4.260.0070.00016.62
7.4.250.0060.00316.70
7.4.240.0040.00516.79
7.4.230.0030.00516.88
7.4.220.0090.01216.85
7.4.210.0050.01316.71
7.4.200.0040.00416.57
7.4.190.0030.00616.88
7.4.160.0090.00916.46
7.4.150.0200.00717.40
7.4.140.0080.01117.86
7.4.130.0060.01416.72
7.4.120.0050.01416.63
7.4.110.0130.00716.72
7.4.100.0120.00916.75
7.4.90.0090.00916.76
7.4.80.0070.01819.39
7.4.70.0060.01316.55
7.4.60.0140.00516.52
7.4.50.0090.00516.38
7.4.40.0100.01119.40
7.4.30.0040.02116.36
7.4.20.0090.01316.31
7.4.10.0110.01116.22
7.4.00.0090.01115.54
7.3.330.0020.00213.13
7.3.320.0000.00512.98
7.3.310.0000.00816.35
7.3.300.0000.00816.36
7.3.290.0130.00316.32
7.3.280.0090.01016.37
7.3.270.0130.01017.40
7.3.260.0070.01316.46
7.3.250.0110.01116.66
7.3.240.0060.01316.70
7.3.230.0090.00916.47
7.3.210.0040.01616.42
7.3.200.0120.01216.52
7.3.190.0100.00816.26
7.3.180.0110.00716.49
7.3.170.0030.01916.31
7.3.160.0120.01216.52
7.3.150.0080.01116.45
7.3.140.0150.00616.39
7.3.130.0120.00816.32
7.3.120.0060.01215.60
7.3.110.0120.01216.56
7.3.100.0100.01316.23
7.3.90.0090.01416.34
7.3.80.0100.00916.53
7.3.70.0090.00916.17
7.3.60.0110.01416.38
7.3.50.0120.00916.21
7.3.40.0130.00416.28
7.3.30.0030.01416.32
7.3.20.0110.01118.13
7.3.10.0090.00918.07
7.3.00.0070.01118.01
7.2.330.0090.01216.50
7.2.320.0100.01016.67
7.2.310.0100.00916.53
7.2.300.0070.01216.34
7.2.290.0080.01316.68
7.2.280.0070.01416.45
7.2.270.0130.01316.44
7.2.260.0100.01016.29
7.2.250.0180.00616.29
7.2.240.0150.00616.48
7.2.230.0060.01616.45
7.2.220.0190.00616.59
7.2.210.0090.00916.34
7.2.200.0090.01516.57
7.2.190.0140.01116.22
7.2.180.0080.01716.41
7.2.170.0110.01416.48
7.2.160.0160.00416.37
7.2.150.0070.01318.35
7.2.140.0090.01818.28
7.2.130.0110.01418.37
7.2.120.0190.01118.22
7.2.110.0080.01518.55
7.2.100.0120.01218.40
7.2.90.0180.00918.31
7.2.80.0120.01318.17
7.2.70.0100.01318.35
7.2.60.0100.00917.62
7.2.50.0100.01018.21
7.2.40.0060.01518.25
7.2.30.0110.01118.32
7.2.20.0030.01718.19
7.2.10.0150.01218.52
7.2.00.0060.01618.92
7.1.330.0150.02117.36
7.1.320.0240.00617.39
7.1.310.0130.01617.45
7.1.300.0220.01517.45
7.1.290.0240.00517.48
7.1.280.0220.00917.60
7.1.270.0220.01517.64
7.1.260.0150.01917.63
7.1.250.0260.00717.23
7.1.240.0230.00917.38
7.1.230.0180.01117.35
7.1.220.0260.00717.47
7.1.210.0180.01217.39
7.1.200.0180.00516.62
7.1.190.0160.01617.34
7.1.180.0170.01717.45
7.1.170.0240.00717.36
7.1.160.0230.01017.41
7.1.150.0290.00317.22
7.1.140.0240.00717.50
7.1.130.0180.01217.30
7.1.120.0230.01717.30
7.1.110.0320.00017.42
7.1.100.0090.01517.82
7.1.90.0150.01517.46
7.1.80.0170.01317.59
7.1.70.0110.01017.29
7.1.60.0110.01818.35
7.1.50.0170.01217.19
7.1.40.0170.01417.54
7.1.30.0200.01017.46
7.1.20.0240.00717.55
7.1.10.0200.01017.66
7.1.00.0150.04420.05
7.0.330.0230.01717.43
7.0.320.0180.01417.03
7.0.310.0240.00617.13
7.0.300.0220.01817.27
7.0.290.0170.01317.30
7.0.280.0160.01317.22
7.0.270.0210.00717.21
7.0.260.0240.00717.13
7.0.250.0210.01217.37
7.0.240.0220.00817.17
7.0.230.0260.00317.23
7.0.220.0150.01517.36
7.0.210.0200.01217.27
7.0.200.0140.00717.07
7.0.190.0150.01517.13
7.0.180.0200.00917.17
7.0.170.0210.00717.18
7.0.160.0100.02017.25
7.0.150.0110.01617.12
7.0.140.0160.04119.62
7.0.130.0190.01117.25
7.0.120.0160.01616.98
7.0.110.0180.01016.99
7.0.100.0170.01717.04
7.0.90.0180.01416.98
7.0.80.0160.04019.51
7.0.70.0110.04019.26
7.0.60.0090.03019.41
7.0.50.0250.03419.64
7.0.40.0230.04618.63
7.0.30.0150.02918.69
7.0.20.0180.04518.66
7.0.10.0180.02718.69
7.0.00.0180.04518.69
5.6.400.0200.01416.12
5.6.390.0170.01615.69
5.6.380.0260.00515.99
5.6.370.0260.00415.65
5.6.360.0410.01216.14
5.6.350.0200.01216.06
5.6.340.0190.01016.10
5.6.330.0230.01415.80
5.6.320.0120.02215.93
5.6.310.0300.00316.04
5.6.300.0170.01416.25
5.6.290.0240.01015.85
5.6.280.0140.04318.78
5.6.270.0290.00416.07
5.6.260.0300.00516.07
5.6.250.0130.01716.05
5.6.240.0180.01816.25
5.6.230.0190.04018.28
5.6.220.0160.04918.16
5.6.210.0130.03318.21
5.6.200.0150.04918.45
5.6.190.0200.04618.58
5.6.180.0180.02718.54
5.6.170.0170.04718.55
5.6.160.0140.03918.71
5.6.150.0090.05218.53
5.6.140.0130.05018.59
5.6.130.0130.05418.63
5.6.120.0160.03818.50
5.6.110.0140.03418.63
5.6.100.0080.05718.48
5.6.90.0080.03718.57
5.6.80.0140.04718.22
5.6.70.0120.03818.25
5.6.60.0090.05018.20
5.6.50.0120.04818.28
5.6.40.0140.03118.22
5.6.30.0080.04918.27
5.6.20.0040.04718.18
5.6.10.0100.05018.29
5.6.00.0150.04318.12
5.5.380.0290.01315.97
5.5.370.0130.04718.17
5.5.360.0170.04018.14
5.5.350.0110.04318.24
5.5.340.0200.04418.40
5.5.330.0230.04018.46
5.5.320.0210.03518.44
5.5.310.0190.04818.45
5.5.300.0110.04618.44
5.5.290.0140.04218.47
5.5.280.0160.03618.30
5.5.270.0150.02718.50
5.5.260.0190.04318.49
5.5.250.0120.04018.24
5.5.240.0100.05818.09
5.5.230.0130.03818.13
5.5.220.0120.03618.06
5.5.210.0130.03718.21
5.5.200.0090.04418.20
5.5.190.0110.04418.11
5.5.180.0090.04718.10
5.5.170.0160.01616.08
5.5.160.0090.03517.88
5.5.150.0130.03717.99
5.5.140.0130.04418.12
5.5.130.0210.03518.06
5.5.120.0150.04718.10
5.5.110.0140.04418.15
5.5.100.0190.02718.03
5.5.90.0100.04617.99
5.5.80.0160.04318.08
5.5.70.0120.04317.99
5.5.60.0120.04517.90
5.5.50.0080.05118.01
5.5.40.0140.04618.05
5.5.30.0120.04518.10
5.5.20.0210.04218.02
5.5.10.0130.04718.14
5.5.00.0190.04517.97
5.4.450.0120.04515.92
5.4.440.0130.04116.03
5.4.430.0120.04016.03
5.4.420.0120.04116.10
5.4.410.0120.04315.88
5.4.400.0090.04115.82
5.4.390.0110.04115.87
5.4.380.0090.04615.88
5.4.370.0160.03715.69
5.4.360.0130.03815.79
5.4.350.0140.02515.80
5.4.340.0130.02815.73
5.4.330.0140.00712.30
5.4.320.0070.02915.76
5.4.310.0100.02515.86
5.4.300.0130.03615.81
5.4.290.0100.04115.79
5.4.280.0080.02815.87
5.4.270.0080.03115.82
5.4.260.0110.03415.87
5.4.250.0100.02115.85
5.4.240.0090.04515.88
5.4.230.0110.04315.79
5.4.220.0170.03715.86
5.4.210.0100.03115.83
5.4.200.0100.04315.88
5.4.190.0120.02515.80
5.4.180.0090.04415.83
5.4.170.0110.03815.79
5.4.160.0090.04815.76
5.4.150.0090.04115.65
5.4.140.0130.02414.53
5.4.130.0160.03314.45
5.4.120.0130.04214.47
5.4.110.0110.04314.61
5.4.100.0130.03314.62
5.4.90.0120.03814.48
5.4.80.0090.03714.53
5.4.70.0120.04214.43
5.4.60.0140.03814.48
5.4.50.0120.03114.55
5.4.40.0160.03414.58
5.4.30.0120.03614.47
5.4.20.0110.02814.46
5.4.10.0130.02614.45
5.4.00.0120.03814.22
5.3.290.0140.03813.98
5.3.280.0140.03813.77
5.3.270.0090.03113.93
5.3.260.0130.04313.92
5.3.250.0150.03814.06
5.3.240.0170.04313.85
5.3.230.0150.04113.85
5.3.220.0120.02613.87
5.3.210.0110.04113.93
5.3.200.0090.04213.76
5.3.190.0130.04413.96
5.3.180.0060.04813.84
5.3.170.0090.03114.04
5.3.160.0090.04813.91
5.3.150.0110.04513.85
5.3.140.0060.04713.85
5.3.130.0110.04413.96
5.3.120.0110.03713.99
5.3.110.0110.04213.91
5.3.100.0080.03413.57
5.3.90.0100.04013.66
5.3.80.0170.04013.51
5.3.70.0070.04513.73
5.3.60.0100.03813.56
5.3.50.0100.04513.49
5.3.40.0080.04113.46
5.3.30.0080.04513.52
5.3.20.0100.03713.35
5.3.10.0100.03813.45
5.3.00.0070.04613.23
5.2.170.0080.03511.99
5.2.160.0070.03711.96
5.2.150.0080.02111.94
5.2.140.0090.03311.90
5.2.130.0080.03511.99
5.2.120.0090.03711.91
5.2.110.0090.04011.90
5.2.100.0070.03611.94
5.2.90.0100.03411.91
5.2.80.0090.02611.88
5.2.70.0080.03811.90
5.2.60.0170.02511.90
5.2.50.0060.03911.90
5.2.40.0030.04211.88
5.2.30.0120.02911.86
5.2.20.0050.04311.83
5.2.10.0080.03311.89
5.2.00.0050.02711.83
5.1.60.0060.01811.83
5.1.50.0030.01911.83
5.1.40.0040.02611.83
5.1.30.0120.02711.83
5.1.20.0110.01711.83
5.1.10.0070.01911.83
5.1.00.0080.03111.83
5.0.50.0040.01811.83
5.0.40.0050.01711.83
5.0.30.0080.02211.83
5.0.20.0060.01411.83
5.0.10.0060.01311.83
5.0.00.0100.02811.83
4.4.90.0050.01411.83
4.4.80.0030.01211.83
4.4.70.0050.01011.83
4.4.60.0050.00811.83
4.4.50.0020.01711.83
4.4.40.0030.01511.83
4.4.30.0050.01811.83
4.4.20.0020.01611.83
4.4.10.0030.01011.83
4.4.00.0010.02311.83
4.3.110.0020.01511.83
4.3.100.0030.00811.83
4.3.90.0030.00811.83
4.3.80.0130.02711.83
4.3.70.0120.01011.83
4.3.60.0040.01611.83
4.3.50.0090.01111.83
4.3.40.0050.02011.83
4.3.30.0040.01011.83
4.3.20.0020.01311.83
4.3.10.0070.01211.83
4.3.00.0040.00811.83

preferences:
41.18 ms | 401 KiB | 5 Q