3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = "°Freenew°\x90ɮ\xc2\xe4dfg\xa0"; //$result = trim($result,"\xc2"/*"\xa0"*/); //echo preg_replace('#[\x00-\x1F\x7F-\x9F]#', '', $result); //reject overly long 2 byte sequences, as well as characters above U+10000 and replace with ? echo preg_replace('/[\x00-\x08\x10\x0B\x0C\x0E-\x19\x7F]'. '|[\x00-\x7F][\x80-\xBF]+'. '|([\xC0\xC1]|[\xF0-\xFF])[\x80-\xBF]*'. '|[\xC2-\xDF]((?![\x80-\xBF])|[\x80-\xBF]{2,})'. '|[\xE0-\xEF](([\x80-\xBF](?![\x80-\xBF]))|(?![\x80-\xBF]{2})|[\x80-\xBF]{3,})/S', '', $result ); /* //reject overly long 3 byte sequences and UTF-16 surrogates and replace with ? $some_string = preg_replace('/\xE0[\x80-\x9F][\x80-\xBF]'. '|\xED[\xA0-\xBF][\x80-\xBF]/S','?', $some_string ); */

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.0040.01116.88
8.3.50.0130.00822.08
8.3.40.0070.00719.15
8.3.30.0140.00019.16
8.3.20.0000.00820.34
8.3.10.0040.00423.65
8.3.00.0040.00419.18
8.2.180.0140.00718.54
8.2.170.0040.01122.96
8.2.160.0100.00320.39
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0030.00520.83
8.2.110.0060.00319.27
8.2.100.0040.00819.89
8.2.90.0050.00319.17
8.2.80.0000.00917.97
8.2.70.0040.00417.63
8.2.60.0090.00018.05
8.2.50.0050.00318.07
8.2.40.0000.00821.23
8.2.30.0000.00718.35
8.2.20.0040.00417.99
8.2.10.0040.00418.11
8.2.00.0000.00818.04
8.1.280.0140.00025.92
8.1.270.0040.00423.79
8.1.260.0080.00026.35
8.1.250.0030.00528.09
8.1.240.0060.00320.81
8.1.230.0000.01119.10
8.1.220.0040.00417.79
8.1.210.0000.00918.77
8.1.200.0000.00917.47
8.1.190.0040.00417.35
8.1.180.0080.00018.10
8.1.170.0040.00418.71
8.1.160.0040.00421.92
8.1.150.0040.00418.73
8.1.140.0000.00717.66
8.1.130.0040.00417.86
8.1.120.0000.00717.44
8.1.110.0000.00717.62
8.1.100.0000.00717.46
8.1.90.0000.00717.55
8.1.80.0030.00517.56
8.1.70.0070.00017.49
8.1.60.0070.00417.68
8.1.50.0040.00517.66
8.1.40.0020.00517.58
8.1.30.0000.00817.74
8.1.20.0030.00517.70
8.1.10.0000.00817.69
8.1.00.0080.00017.48
8.0.300.0040.00418.77
8.0.290.0040.00417.30
8.0.280.0000.00718.50
8.0.270.0070.00017.36
8.0.260.0030.00317.18
8.0.250.0070.00017.12
8.0.240.0000.00817.03
8.0.230.0030.00316.98
8.0.220.0040.00317.05
8.0.210.0040.00416.95
8.0.200.0000.00817.03
8.0.190.0070.00017.04
8.0.180.0040.00417.02
8.0.170.0040.00416.96
8.0.160.0040.00416.85
8.0.150.0030.00616.86
8.0.140.0070.00016.92
8.0.130.0000.00613.42
8.0.120.0000.00816.96
8.0.110.0080.00017.13
8.0.100.0030.00516.96
8.0.90.0070.00017.09
8.0.80.0000.01517.13
8.0.70.0050.00316.90
8.0.60.0050.00217.02
8.0.50.0030.00516.93
8.0.30.0160.00416.99
8.0.20.0130.00517.40
8.0.10.0040.00416.99
8.0.00.0090.00916.97
7.4.330.0000.00615.00
7.4.320.0060.00016.74
7.4.300.0060.00316.82
7.4.290.0040.00416.76
7.4.280.0040.00416.85
7.4.270.0040.00416.85
7.4.260.0030.00316.74
7.4.250.0000.00716.66
7.4.240.0020.00616.88
7.4.230.0070.00016.82
7.4.220.0090.00916.83
7.4.210.0020.01216.79
7.4.200.0000.00716.68
7.4.190.0050.00216.93
7.4.160.0030.01616.55
7.4.150.0120.00617.40
7.4.140.0110.01317.86
7.4.130.0100.00616.73
7.4.120.0070.01016.81
7.4.110.0150.00716.71
7.4.100.0120.00616.65
7.4.90.0100.00716.67
7.4.80.0070.01119.39
7.4.70.0140.00316.60
7.4.60.0130.00316.63
7.4.50.0030.00616.77
7.4.40.0030.01416.74
7.4.30.0060.01016.64
7.4.00.0040.01214.99
7.3.330.0020.00213.16
7.3.320.0040.00413.24
7.3.310.0040.00416.25
7.3.300.0000.00716.33
7.3.290.0090.00916.27
7.3.280.0060.00916.31
7.3.270.0170.00017.40
7.3.260.0140.00316.64
7.3.250.0080.00916.53
7.3.240.0140.01116.69
7.3.230.0100.00716.76
7.3.210.0140.00316.53
7.3.200.0060.01619.39
7.3.190.0060.01216.62
7.3.180.0090.00616.33
7.3.170.0040.01116.36
7.3.160.0090.00616.41
7.3.120.0070.00715.05
7.3.110.0030.01314.80
7.3.100.0040.01114.91
7.3.90.0060.00614.99
7.3.80.0060.00614.86
7.3.70.0100.00314.68
7.3.60.0070.00014.75
7.3.50.0080.00815.01
7.3.40.0040.01214.95
7.3.30.0070.00715.02
7.3.20.0030.01016.64
7.3.10.0030.01016.48
7.3.00.0030.00716.63
7.2.330.0060.01216.72
7.2.320.0060.01316.66
7.2.310.0090.00916.65
7.2.300.0120.00616.58
7.2.290.0130.00916.47
7.2.240.0070.00714.84
7.2.230.0030.01515.07
7.2.220.0120.00615.11
7.2.210.0120.00015.00
7.2.200.0000.01015.01
7.2.190.0030.00714.96
7.2.180.0070.00714.95
7.2.170.0000.01215.00
7.2.160.0040.01414.79
7.2.150.0030.01216.88
7.2.140.0060.00917.09
7.2.130.0140.00016.75
7.2.120.0070.00416.88
7.2.110.0030.01217.00
7.2.100.0110.00416.99
7.2.90.0060.00617.19
7.2.80.0020.01017.00
7.2.70.0080.01116.95
7.2.60.0100.01016.79
7.2.50.0140.00916.85
7.2.40.0110.01417.09
7.2.30.0150.01116.89
7.2.20.0130.01016.98
7.2.10.0160.01016.87
7.2.00.0140.01016.70
7.1.330.0040.01115.74
7.1.320.0000.01316.04
7.1.310.0050.00515.73
7.1.300.0030.01015.82
7.1.290.0000.01316.04
7.1.280.0030.01015.96
7.1.270.0030.01015.87
7.1.260.0030.01415.94
7.1.250.0000.01416.09
7.1.70.0030.01017.21
7.1.60.0100.01619.46
7.1.50.0000.02216.80
7.1.00.0030.07722.34
7.0.200.0040.00416.68
7.0.140.0070.07022.04
7.0.80.0700.03319.89
7.0.70.0570.08019.90
7.0.60.0470.05319.96
7.0.50.0530.05020.36
7.0.40.0070.04320.09
7.0.30.0070.08320.11
7.0.20.0030.06320.10
7.0.10.0030.04320.05
7.0.00.0230.07020.12
5.6.280.0100.07021.12
5.6.230.0000.09020.74
5.6.220.0030.06020.57
5.6.210.0030.06720.46
5.6.200.0070.07020.95
5.6.190.0100.07721.02
5.6.180.0100.04321.03
5.6.170.0000.05021.03
5.6.160.0100.07321.07
5.6.150.0100.08021.00
5.6.140.0130.04721.10
5.6.130.0100.07721.06
5.6.120.0200.06020.95
5.6.110.0130.07320.97
5.6.100.0200.07020.98
5.6.90.0030.08320.91
5.6.80.0070.04320.41
5.6.70.0000.08320.45
5.6.60.0030.08320.47
5.6.50.0130.07320.51
5.6.40.0070.08020.43
5.6.30.0130.06020.39
5.6.20.0030.08320.43
5.6.10.0000.05320.48
5.6.00.0100.04720.27
5.5.370.0130.07320.54
5.5.360.0030.05320.35
5.5.350.0100.07020.46
5.5.340.0170.05720.86
5.5.330.0030.07320.90
5.5.320.0100.06720.75
5.5.310.0070.05320.82
5.5.300.0200.07320.89
5.5.290.0070.04720.77
5.5.280.0100.05020.63
5.5.270.0130.07020.81
5.5.260.0070.06020.91
5.5.250.0030.08720.70
5.5.240.0070.04020.21
5.5.230.0030.07720.28
5.5.220.0130.06320.20
5.5.210.0130.07720.17
5.5.200.0000.07720.08
5.5.190.0030.07720.18
5.5.180.0130.07020.15
5.5.160.0030.05020.17
5.5.150.0100.06020.20
5.5.140.0030.07020.07
5.5.130.0030.07720.14
5.5.120.0070.07720.17
5.5.110.0030.08320.21
5.5.100.0100.07319.97
5.5.90.0170.05719.94
5.5.80.0100.05020.05
5.5.70.0030.08019.99
5.5.60.0100.07719.92
5.5.50.0100.07320.09
5.5.40.0130.07320.02
5.5.30.0000.08020.10
5.5.20.0030.08320.02
5.5.10.0100.04320.03
5.5.00.0030.07720.09
5.4.450.0000.04319.38
5.4.440.0030.08019.11
5.4.430.0130.07719.38
5.4.420.0170.06319.41
5.4.410.0100.04319.27
5.4.400.0100.04719.07
5.4.390.0100.07019.07
5.4.380.0130.07019.03
5.4.370.0030.06318.81
5.4.360.0070.07718.78
5.4.350.0030.07718.90
5.4.340.0070.08018.81
5.4.320.0000.08018.79
5.4.310.0070.07318.97
5.4.300.0100.06318.98
5.4.290.0130.06718.97
5.4.280.0000.08719.03
5.4.270.0200.07019.07
5.4.260.0000.07718.98
5.4.250.0170.07019.02
5.4.240.0000.04719.06
5.4.230.0170.06018.77
5.4.220.0030.04018.96
5.4.210.0070.04018.80
5.4.200.0070.07319.02
5.4.190.0030.07318.95
5.4.180.0070.07319.02
5.4.170.0100.03318.89
5.4.160.0030.05019.02
5.4.150.0030.03718.90
5.4.140.0000.03716.37
5.4.130.0030.03316.38
5.4.120.0030.03316.29
5.4.110.0030.03716.23
5.4.100.0000.03716.25
5.4.90.0000.03716.23
5.4.80.0130.02316.46
5.4.70.0000.03716.42
5.4.60.0000.03716.32
5.4.50.0100.02716.38
5.4.40.0000.05316.36
5.4.30.0100.03016.23
5.4.20.0070.03716.28
5.4.10.0070.03316.33
5.4.00.0000.03716.23
5.3.290.0170.07016.23
5.3.280.0070.07316.23
5.3.270.0170.07016.23
5.3.260.0000.05016.23
5.3.250.0000.03716.23
5.3.240.0030.04316.23
5.3.230.0000.04016.23
5.3.220.0000.04016.23
5.3.210.0030.04316.23
5.3.200.0070.03716.23
5.3.190.0070.03316.23
5.3.180.0030.03316.23
5.3.170.0030.03716.23
5.3.160.0030.03716.23
5.3.150.0030.03716.23
5.3.140.0000.04016.23
5.3.130.0030.03316.23
5.3.120.0030.05316.23
5.3.110.0000.04316.23
5.3.100.0030.03716.23
5.3.90.0030.03716.23
5.3.80.0130.06316.23
5.3.70.0130.02716.23
5.3.60.0070.04016.23
5.3.50.0070.03316.23
5.3.40.0030.03316.23
5.3.30.0030.03716.23
5.3.20.0070.03016.23
5.3.10.0000.06716.23
5.3.00.0030.03016.23
5.2.170.0030.03016.23
5.2.160.0000.03016.23
5.2.150.0000.02716.23
5.2.140.0070.02716.23
5.2.130.0070.02716.23
5.2.120.0070.02316.23
5.2.110.0030.03316.23
5.2.100.0000.03016.23
5.2.90.0070.02016.23
5.2.80.0030.02716.23
5.2.70.0030.03016.23
5.2.60.0030.02716.23
5.2.50.0000.02716.23
5.2.40.0030.02716.23
5.2.30.0000.03016.23
5.2.20.0000.03016.23
5.2.10.0070.02716.23
5.2.00.0000.03016.23
5.1.60.0030.02316.23
5.1.50.0030.02316.23
5.1.40.0030.02316.23
5.1.30.0000.02716.23
5.1.20.0070.02016.23
5.1.10.0000.02716.23
5.1.00.0070.02016.23
5.0.50.0000.01716.23
5.0.40.0030.02316.23
5.0.30.0000.03016.23
5.0.20.0000.02016.23
5.0.10.0000.02016.23
5.0.00.0000.04716.23
4.4.90.0000.01716.23
4.4.80.0000.01716.23
4.4.70.0000.01716.23
4.4.60.0030.01016.23
4.4.50.0000.02016.23
4.4.40.0000.02316.23
4.4.30.0030.01316.23
4.4.20.0000.01716.23
4.4.10.0000.01716.23
4.4.00.0000.02316.23
4.3.110.0070.01716.23
4.3.100.0030.01316.23
4.3.90.0030.01016.23
4.3.80.0000.02316.23
4.3.70.0000.01316.23
4.3.60.0000.02016.23
4.3.50.0030.01016.23
4.3.40.0000.02316.23
4.3.30.0000.01316.23
4.3.20.0070.01016.23
4.3.10.0000.01716.23
4.3.00.0000.01316.23

preferences:
44.79 ms | 401 KiB | 5 Q