3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = "°Freen\x18 ew°\x90ɮ\x7F\xc2"; //$result = preg_replace('~[\x{0000}-\x{000F}\x{007F}-\x{00a0}]~S', '', $result); $result = preg_replace('~[\x{0000}-\x{000F}\x{007F}-\x{00a0}\xe0\xb8\xa2]~', '', $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 ); */ 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.00018.43
8.3.50.0070.01221.14
8.3.40.0120.00618.92
8.3.30.0060.00919.93
8.3.20.0040.00420.16
8.3.10.0080.00020.92
8.3.00.0040.00422.39
8.2.180.0180.00416.63
8.2.170.0120.00622.96
8.2.160.0070.01422.13
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0050.00320.79
8.2.110.0000.00919.33
8.2.100.0070.00417.84
8.2.90.0090.00019.08
8.2.80.0080.00317.97
8.2.70.0040.00417.63
8.2.60.0030.00518.04
8.2.50.0030.00618.07
8.2.40.0000.00818.03
8.2.30.0000.00719.51
8.2.20.0040.00417.73
8.2.10.0000.00717.97
8.2.00.0000.00817.95
8.1.280.0070.01025.92
8.1.270.0040.00423.99
8.1.260.0070.01126.35
8.1.250.0060.00328.09
8.1.240.0040.01522.32
8.1.230.0040.00720.95
8.1.220.0060.00318.77
8.1.210.0060.00320.82
8.1.200.0030.00717.47
8.1.190.0050.00317.40
8.1.180.0000.00818.10
8.1.170.0000.00918.65
8.1.160.0000.00718.85
8.1.150.0000.00718.80
8.1.140.0000.00717.59
8.1.130.0070.00017.87
8.1.120.0040.00417.55
8.1.110.0030.00617.52
8.1.100.0050.00317.42
8.1.90.0000.00717.46
8.1.80.0040.00417.42
8.1.70.0030.00317.57
8.1.60.0000.00817.68
8.1.50.0000.00817.57
8.1.40.0040.00417.57
8.1.30.0060.00317.74
8.1.20.0000.00917.79
8.1.10.0040.00417.57
8.1.00.0040.00417.54
8.0.300.0040.00420.04
8.0.290.0000.00717.17
8.0.280.0040.00418.52
8.0.270.0040.00217.28
8.0.260.0000.00716.96
8.0.250.0000.00717.13
8.0.240.0060.00617.11
8.0.230.0000.00716.91
8.0.220.0030.00316.91
8.0.210.0000.00716.87
8.0.200.0060.00017.09
8.0.190.0000.00817.02
8.0.180.0000.00817.00
8.0.170.0040.00417.00
8.0.160.0030.00516.89
8.0.150.0040.00416.79
8.0.140.0070.00016.93
8.0.130.0000.00513.45
8.0.120.0040.00416.95
8.0.110.0000.00716.89
8.0.100.0040.00417.02
8.0.90.0000.00716.88
8.0.80.0060.00917.02
8.0.70.0020.00516.88
8.0.60.0040.00416.85
8.0.50.0040.00416.86
8.0.30.0150.00617.10
8.0.20.0100.00817.42
8.0.10.0000.00717.18
8.0.00.0120.01217.00
7.4.330.0020.00316.86
7.4.320.0000.00616.76
7.4.300.0000.00616.75
7.4.290.0000.00816.65
7.4.280.0030.00316.64
7.4.270.0070.00016.77
7.4.260.0000.00513.42
7.4.250.0070.00016.59
7.4.240.0020.00516.74
7.4.230.0050.00316.72
7.4.220.0200.00716.83
7.4.210.0050.01016.69
7.4.200.0070.00016.66
7.4.190.0040.00416.82
7.4.160.0090.00616.52
7.4.150.0130.00417.40
7.4.140.0110.00717.86
7.4.130.0130.00416.73
7.4.120.0160.00416.56
7.4.110.0060.01516.89
7.4.100.0090.00916.64
7.4.90.0130.00516.44
7.4.80.0090.01319.39
7.4.70.0090.01016.52
7.4.60.0070.01116.59
7.4.50.0040.00416.72
7.4.40.0120.00622.77
7.4.30.0060.01116.50
7.4.00.0000.00914.84
7.3.330.0060.00013.25
7.3.320.0000.00513.19
7.3.310.0050.00316.36
7.3.300.0070.00016.39
7.3.290.0080.00716.37
7.3.280.0100.00716.37
7.3.270.0070.01017.40
7.3.260.0060.01218.24
7.3.250.0160.00516.36
7.3.240.0040.01216.29
7.3.230.0140.00516.45
7.3.210.0030.01316.44
7.3.200.0140.00619.39
7.3.190.0140.00316.64
7.3.180.0120.00316.50
7.3.170.0060.01216.59
7.3.160.0090.00916.60
7.3.120.0060.00914.86
7.3.10.0060.01016.30
7.3.00.0120.00316.56
7.2.330.0100.00716.68
7.2.320.0070.01316.64
7.2.310.0160.00616.72
7.2.300.0100.00616.79
7.2.290.0030.01616.77
7.2.130.0040.01117.02
7.2.120.0070.00716.83
7.2.110.0090.00816.90
7.2.100.0090.00816.78
7.2.90.0080.00716.86
7.2.80.0050.01016.86
7.2.70.0110.00816.83
7.2.60.0090.00716.94
7.2.50.0100.00516.87
7.2.40.0100.00916.74
7.2.30.0110.00616.88
7.2.20.0120.00716.83
7.2.10.0070.00716.91
7.2.00.0050.01117.85
7.1.250.0040.01015.71
7.1.100.0060.00617.82
7.1.70.0000.00917.41
7.1.60.0090.01219.17
7.1.50.0130.01017.20
7.1.00.0000.03722.29
7.0.200.0090.00614.77
7.0.140.0100.07022.07
7.0.80.0100.08719.99
7.0.70.0000.06019.91
7.0.60.0100.08319.97
7.0.50.0070.08020.29
7.0.40.0130.07020.05
7.0.30.0070.07720.13
7.0.20.0070.06020.10
7.0.10.0130.07320.12
7.0.00.0000.04720.09
5.6.280.0000.07721.04
5.6.230.0030.08720.63
5.6.220.0070.08320.52
5.6.210.0070.08720.57
5.6.200.0100.08321.02
5.6.190.0100.08321.07
5.6.180.0100.07721.04
5.6.170.0130.07321.06
5.6.160.0100.08021.07
5.6.150.0070.09021.08
5.6.140.0070.07721.04
5.6.130.0200.05721.07
5.6.120.0170.07321.04
5.6.110.0030.06721.09
5.6.100.0070.08320.96
5.6.90.0170.05720.99
5.6.80.0130.07720.55
5.6.70.0100.06320.44
5.6.60.0130.04720.45
5.6.50.0070.07720.43
5.6.40.0030.06320.32
5.6.30.0130.06320.39
5.6.20.0030.05720.43
5.6.10.0130.07020.28
5.6.00.0070.08720.29
5.5.370.0000.06720.36
5.5.360.0030.08320.41
5.5.350.0070.05320.37
5.5.340.0030.05720.87
5.5.330.0000.06020.93
5.5.320.0070.08320.89
5.5.310.0070.07320.83
5.5.300.0130.08720.74
5.5.290.0100.08320.91
5.5.280.0070.08720.87
5.5.270.0130.03720.74
5.5.260.0000.07720.82
5.5.250.0070.08320.58
5.5.240.0100.07720.18
5.5.230.0170.06020.09
5.5.220.0070.07020.15
5.5.210.0070.07020.26
5.5.200.0070.04020.17
5.5.190.0100.07720.23
5.5.180.0070.06019.97
5.5.160.0130.07020.25
5.5.150.0070.04720.08
5.5.140.0030.04020.16
5.5.130.0100.06020.08
5.5.120.0130.03320.24
5.5.110.0070.03720.19
5.5.100.0070.04020.03
5.5.90.0030.04020.07
5.5.80.0100.04020.20
5.5.70.0030.04020.12
5.5.60.0130.03320.08
5.5.50.0030.04020.11
5.5.40.0030.04020.08
5.5.30.0070.05020.13
5.5.20.0130.04020.08
5.5.10.0070.06320.11
5.5.00.0070.05020.03
5.4.450.0030.08319.35
5.4.440.0130.07719.11
5.4.430.0100.07719.39
5.4.420.0170.06319.22
5.4.410.0030.07719.22
5.4.400.0170.07019.09
5.4.390.0070.07319.13
5.4.380.0170.06719.03
5.4.370.0070.06319.01
5.4.360.0070.04718.96
5.4.350.0030.07318.83
5.4.340.0070.05718.83
5.4.320.0100.05719.06
5.4.310.0030.07319.23
5.4.300.0030.04318.80
5.4.290.0130.03318.98
5.4.280.0100.03319.07
5.4.270.0000.04018.94
5.4.260.0030.03718.96
5.4.250.0030.04719.06
5.4.240.0030.03719.02
5.4.230.0030.04019.04
5.4.220.0070.03318.97
5.4.210.0100.03718.94
5.4.200.0070.04719.00
5.4.190.0070.03718.97
5.4.180.0000.04318.95
5.4.170.0070.07019.05
5.4.160.0030.04019.20
5.4.150.0100.04018.94
5.4.140.0000.04016.27
5.4.130.0000.03716.27
5.4.120.0070.03716.38
5.4.110.0100.04316.27
5.4.100.0070.04016.45
5.4.90.0070.03316.22
5.4.80.0130.04716.19
5.4.70.0070.03016.28
5.4.60.0070.03316.32
5.4.50.0000.03716.36
5.4.40.0100.04716.37
5.4.30.0030.03716.23
5.4.20.0070.06316.33
5.4.10.0100.03016.23
5.4.00.0070.04015.72
5.3.290.0130.07314.64
5.3.280.0070.03314.57
5.3.270.0070.04014.43
5.3.260.0030.03714.59
5.3.250.0070.03714.57
5.3.240.0000.04014.61
5.3.230.0070.05314.42
5.3.220.0030.03714.42
5.3.210.0030.04314.53
5.3.200.0000.04014.54
5.3.190.0030.03014.39
5.3.180.0070.03314.47
5.3.170.0070.03314.50
5.3.160.0000.04314.50
5.3.150.0070.04014.51
5.3.140.0070.03314.41
5.3.130.0070.05014.48
5.3.120.0100.05014.40
5.3.110.0000.03314.48
5.3.100.0030.04013.98
5.3.90.0030.04013.96
5.3.80.0070.03714.00
5.3.70.0000.04013.87
5.3.60.0030.03713.95
5.3.50.0000.03313.93
5.3.40.0070.07313.88
5.3.30.0000.03313.84
5.3.20.0000.03713.54
5.3.10.0070.05313.63
5.3.00.0000.03713.58
5.2.170.0070.02711.54
5.2.160.0030.05711.54
5.2.150.0000.02711.54
5.2.140.0000.02711.54
5.2.130.0000.03011.54
5.2.120.0070.04311.54
5.2.110.0000.03011.54
5.2.100.0070.02011.54
5.2.90.0030.03011.54
5.2.80.0000.03011.54
5.2.70.0000.04311.54
5.2.60.0000.02711.54
5.2.50.0000.03311.54
5.2.40.0030.06011.54
5.2.30.0100.05711.54
5.2.20.0070.04711.54
5.2.10.0070.05711.54
5.2.00.0030.06311.54
5.1.60.0030.04011.54
5.1.50.0200.03711.54
5.1.40.0000.04311.54
5.1.30.0070.04711.54
5.1.20.0030.05311.54
5.1.10.0070.05711.54
5.1.00.0030.05711.54
5.0.50.0030.02311.54
5.0.40.0070.03711.54
5.0.30.0000.06711.54
5.0.20.0070.02711.54
5.0.10.0030.04311.54
5.0.00.0070.05311.54
4.4.90.0070.01311.54
4.4.80.0000.01711.54
4.4.70.0000.02011.54
4.4.60.0070.03011.54
4.4.50.0030.03311.54
4.4.40.0070.05011.54
4.4.30.0000.03711.54
4.4.20.0030.03311.54
4.4.10.0000.03711.54
4.4.00.0000.05311.54
4.3.110.0000.02711.54
4.3.100.0030.02011.54
4.3.90.0000.03711.54
4.3.80.0170.03311.54
4.3.70.0130.02011.54
4.3.60.0100.02711.54
4.3.50.0030.03311.54
4.3.40.0030.04011.54
4.3.30.0000.03011.54
4.3.20.0070.03311.54
4.3.10.0000.03711.54
4.3.00.0000.03711.54

preferences:
34.41 ms | 401 KiB | 5 Q