3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = "°Freenew°\x90ɮ\xc2\xe4dfg"; //$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.0140.00318.43
8.3.50.0110.00622.19
8.3.40.0040.01218.84
8.3.30.0130.00618.77
8.3.20.0040.00418.95
8.3.10.0150.00019.29
8.3.00.0040.00421.64
8.2.180.0180.00416.63
8.2.170.0060.00922.96
8.2.160.0100.00720.28
8.2.150.0080.00024.18
8.2.140.0140.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00019.66
8.2.110.0040.00420.52
8.2.100.0060.00618.03
8.2.90.0000.00819.21
8.2.80.0040.00417.97
8.2.70.0030.00517.63
8.2.60.0050.00318.03
8.2.50.0110.00018.07
8.2.40.0000.00818.34
8.2.30.0040.00419.37
8.2.20.0000.00717.78
8.2.10.0040.00417.91
8.2.00.0050.00517.80
8.1.280.0110.00425.92
8.1.270.0070.00023.99
8.1.260.0060.00326.35
8.1.250.0050.00328.09
8.1.240.0060.00620.81
8.1.230.0080.00420.88
8.1.220.0080.00018.77
8.1.210.0040.00418.82
8.1.200.0030.00617.48
8.1.190.0000.00717.52
8.1.180.0000.00818.10
8.1.170.0030.00618.63
8.1.160.0000.00718.95
8.1.150.0000.00718.86
8.1.140.0040.00417.59
8.1.130.0000.00817.96
8.1.120.0030.00317.61
8.1.110.0070.00017.45
8.1.100.0030.00517.59
8.1.90.0030.00517.45
8.1.80.0000.00717.56
8.1.70.0070.00017.50
8.1.60.0040.00417.67
8.1.50.0050.00217.61
8.1.40.0000.00917.64
8.1.30.0040.00417.65
8.1.20.0040.00417.77
8.1.10.0000.00817.76
8.1.00.0000.00717.65
8.0.300.0060.00320.15
8.0.290.0070.00017.18
8.0.280.0030.00318.48
8.0.270.0040.00417.21
8.0.260.0030.00317.00
8.0.250.0040.00417.02
8.0.240.0050.00217.14
8.0.230.0000.00717.09
8.0.220.0050.00317.05
8.0.210.0000.00717.09
8.0.200.0030.00316.96
8.0.190.0080.00016.94
8.0.180.0040.00417.09
8.0.170.0080.00017.00
8.0.160.0040.00416.91
8.0.150.0040.00416.92
8.0.140.0050.00216.93
8.0.130.0040.00413.43
8.0.120.0000.00716.92
8.0.110.0050.00216.95
8.0.100.0000.00717.04
8.0.90.0040.00416.97
8.0.80.0120.00317.04
8.0.70.0040.00417.11
8.0.60.0040.00416.93
8.0.50.0050.00217.01
8.0.30.0110.00817.16
8.0.20.0140.02217.40
8.0.10.0000.00817.26
8.0.00.0110.00617.01
7.4.330.0050.00016.91
7.4.320.0000.00616.86
7.4.300.0060.00016.75
7.4.290.0000.00716.79
7.4.280.0070.00016.75
7.4.270.0070.00016.90
7.4.260.0030.00313.50
7.4.250.0040.00416.79
7.4.240.0030.00316.74
7.4.230.0080.00016.74
7.4.220.0110.00616.83
7.4.210.0090.00716.79
7.4.200.0030.00316.83
7.4.190.0030.00316.95
7.4.160.0100.00616.77
7.4.150.0100.00617.40
7.4.140.0100.01117.86
7.4.130.0120.01116.68
7.4.120.0080.01016.73
7.4.110.0140.00316.59
7.4.100.0100.00716.68
7.4.90.0120.00616.67
7.4.80.0070.01319.39
7.4.70.0030.01316.56
7.4.60.0100.00916.68
7.4.50.0030.00616.64
7.4.40.0030.01122.77
7.4.30.0110.00616.64
7.4.00.0000.01515.09
7.3.330.0000.00513.21
7.3.320.0000.00513.04
7.3.310.0000.00716.32
7.3.300.0040.00416.30
7.3.290.0110.00416.29
7.3.280.0070.00816.26
7.3.270.0110.00717.40
7.3.260.0120.00818.24
7.3.250.0070.01116.40
7.3.240.0100.00716.62
7.3.230.0130.00316.53
7.3.210.0100.00716.40
7.3.200.0100.00819.39
7.3.190.0040.01216.60
7.3.180.0060.01016.53
7.3.170.0150.00016.65
7.3.160.0060.00916.30
7.3.120.0100.00714.87
7.2.330.0060.01216.70
7.2.320.0090.00916.70
7.2.310.0150.00616.55
7.2.300.0110.00616.81
7.2.290.0100.01316.60
7.2.00.0030.01419.32
7.1.100.0040.01118.18
7.1.70.0060.00317.24
7.1.60.0100.01419.40
7.1.50.0180.00716.78
7.1.00.0000.05722.47
7.0.200.0030.00516.75
7.0.140.0130.06322.12
7.0.70.0000.06321.69
7.0.60.0000.05021.73
7.0.50.0070.08722.04
7.0.40.0000.09320.16
7.0.30.0100.08320.18
7.0.20.0100.04720.09
7.0.10.0130.07720.01
7.0.00.0070.09020.07
5.6.280.0100.06320.85
5.6.220.0070.04020.66
5.6.210.0030.04320.57
5.6.200.0070.09020.95
5.6.190.0070.05021.07
5.6.180.0100.08321.02
5.6.170.0000.07721.10
5.6.160.0100.07321.12
5.6.150.0170.08021.05
5.6.140.0030.08321.03
5.6.130.0030.09321.01
5.6.120.0030.09320.98
5.6.110.0130.07721.00
5.6.100.0100.08021.11
5.6.90.0030.06321.14
5.6.80.0070.08320.44
5.6.70.0000.08020.31
5.6.60.0130.08720.31
5.6.50.0070.09020.43
5.6.40.0100.07720.46
5.6.30.0130.08020.44
5.6.20.0000.08720.38
5.6.10.0100.05320.28
5.6.00.0100.08020.38
5.5.360.0000.04320.41
5.5.350.0000.04720.46
5.5.340.0100.07320.64
5.5.330.0000.09020.72
5.5.320.0030.07720.91
5.5.310.0070.04320.63
5.5.300.0100.06320.91
5.5.290.0030.08320.91
5.5.280.0170.07020.61
5.5.270.0070.06720.91
5.5.260.0000.06320.75
5.5.250.0170.07320.60
5.5.240.0070.08320.26
5.5.230.0100.07320.17
5.5.220.0030.07020.25
5.5.210.0130.07020.29
5.5.200.0030.04720.26
5.5.190.0200.06319.98
5.5.180.0070.07720.12
5.5.160.0130.06720.27
5.5.150.0000.05720.27
5.5.140.0100.05320.09
5.5.130.0100.05720.20
5.5.120.0100.06720.16
5.5.110.0030.07020.09
5.5.100.0030.09020.07
5.5.90.0070.08320.08
5.5.80.0070.06020.06
5.5.70.0200.04320.11
5.5.60.0100.07720.09
5.5.50.0070.04720.05
5.5.40.0100.06020.08
5.5.30.0100.08020.14
5.5.20.0170.07019.95
5.5.10.0130.08020.05
5.5.00.0070.04719.98
5.4.450.0070.07719.38
5.4.440.0070.08319.40
5.4.430.0130.07719.35
5.4.420.0030.08319.46
5.4.410.0000.06019.31
5.4.400.0100.08018.79
5.4.390.0030.08019.23
5.4.380.0070.07719.14
5.4.370.0130.06319.12
5.4.360.0100.07719.23
5.4.350.0070.04718.81
5.4.340.0030.07718.98
5.4.320.0130.06319.03
5.4.310.0100.04318.95
5.4.300.0070.07018.96
5.4.290.0100.03318.98
5.4.280.0170.07318.94
5.4.270.0130.07318.94
5.4.260.0130.07318.78
5.4.250.0070.05019.02
5.4.240.0100.04318.97
5.4.230.0030.07319.07
5.4.220.0030.07719.04
5.4.210.0270.04019.22
5.4.200.0100.07319.11
5.4.190.0100.07719.06
5.4.180.0000.08719.11
5.4.170.0070.06319.05
5.4.160.0100.07018.96
5.4.150.0070.08318.92
5.4.140.0000.05016.33
5.4.130.0100.07016.36
5.4.120.0100.03716.28
5.4.110.0100.07716.29
5.4.100.0070.07316.38
5.4.90.0100.05316.36
5.4.80.0030.05316.29
5.4.70.0030.05316.33
5.4.60.0030.04016.35
5.4.50.0000.05316.31
5.4.40.0100.05716.47
5.4.30.0030.04316.18
5.4.20.0030.05316.26
5.4.10.0000.04716.23
5.4.00.0100.07315.88
5.3.290.0100.05314.52
5.3.280.0130.05014.56
5.3.270.0100.05314.46
5.3.260.0070.07314.58
5.3.250.0130.06714.57
5.3.240.0100.06714.46
5.3.230.0100.05314.58
5.3.220.0030.08014.54
5.3.210.0130.07314.54
5.3.200.0030.05714.57
5.3.190.0170.05014.55
5.3.180.0100.07314.54
5.3.170.0070.05014.48
5.3.160.0170.06714.40
5.3.150.0030.04714.50
5.3.140.0070.05014.51
5.3.130.0230.06014.40
5.3.120.0070.06314.49
5.3.110.0030.05314.40
5.3.100.0030.07714.04
5.3.90.0000.08013.98
5.3.80.0030.08014.02
5.3.70.0030.09013.77
5.3.60.0000.07713.86
5.3.50.0030.07713.89
5.3.40.0100.06713.80
5.3.30.0030.05013.88
5.3.20.0070.07013.68
5.3.10.0000.04313.43
5.3.00.0070.04313.61
5.2.170.0070.06312.31
5.2.160.0100.06012.31
5.2.150.0100.05712.31
5.2.140.0070.05012.31
5.2.130.0030.04312.31
5.2.120.0070.04312.31
5.2.110.0030.03712.31
5.2.100.0030.03712.31
5.2.90.0030.06312.31
5.2.80.0030.05312.31
5.2.70.0000.07012.31
5.2.60.0130.05312.31
5.2.50.0070.06712.31
5.2.40.0000.04712.31
5.2.30.0070.06012.31
5.2.20.0030.06712.31
5.2.10.0100.03712.31
5.2.00.0030.03312.31
5.1.60.0130.04312.31
5.1.50.0100.05012.31
5.1.40.0100.05012.31
5.1.30.0030.05712.31
5.1.20.0000.06012.31
5.1.10.0070.05312.31
5.1.00.0070.05712.31
5.0.50.0030.03312.31
5.0.40.0000.04312.31
5.0.30.0030.06312.31
5.0.20.0030.04712.31
5.0.10.0100.02712.31
5.0.00.0070.06012.31
4.4.90.0030.02312.31
4.4.80.0030.02712.31
4.4.70.0030.03312.31
4.4.60.0030.03012.31
4.4.50.0000.02712.31
4.4.40.0000.05012.31
4.4.30.0030.03012.31
4.4.20.0030.03312.31
4.4.10.0000.03312.31
4.4.00.0030.04712.31
4.3.110.0000.02712.31
4.3.100.0000.02712.31
4.3.90.0000.02712.31
4.3.80.0000.03712.31
4.3.70.0000.03712.31
4.3.60.0000.03312.31
4.3.50.0000.03712.31
4.3.40.0000.04012.31
4.3.30.0070.03012.31
4.3.20.0030.03712.31
4.3.10.0000.04012.31
4.3.00.0070.03012.31

preferences:
45.16 ms | 401 KiB | 5 Q