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.0120.00616.71
8.3.50.0120.00322.14
8.3.40.0070.00718.96
8.3.30.0070.01118.89
8.3.20.0080.00020.39
8.3.10.0080.00023.44
8.3.00.0080.00020.84
8.2.180.0110.00716.88
8.2.170.0040.01222.96
8.2.160.0140.00020.35
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0150.00021.02
8.2.110.0060.00322.44
8.2.100.0060.00618.03
8.2.90.0030.00619.36
8.2.80.0040.00417.97
8.2.70.0040.00417.75
8.2.60.0040.00417.80
8.2.50.0000.00918.07
8.2.40.0090.00020.07
8.2.30.0000.00718.32
8.2.20.0000.00717.97
8.2.10.0000.00818.17
8.2.00.0060.00317.80
8.1.280.0000.01825.92
8.1.270.0080.00023.91
8.1.260.0000.00826.35
8.1.250.0140.00428.09
8.1.240.0090.00023.96
8.1.230.0030.00718.97
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0090.00017.48
8.1.190.0050.00317.38
8.1.180.0030.00518.10
8.1.170.0000.00918.62
8.1.160.0040.00421.96
8.1.150.0000.00818.82
8.1.140.0070.00017.68
8.1.130.0030.00318.01
8.1.120.0040.00417.48
8.1.110.0000.00817.59
8.1.100.0040.00417.47
8.1.90.0000.00717.63
8.1.80.0080.00017.51
8.1.70.0030.00317.52
8.1.60.0030.00617.75
8.1.50.0000.00817.71
8.1.40.0000.00917.62
8.1.30.0040.00417.76
8.1.20.0000.00817.77
8.1.10.0070.00017.63
8.1.00.0060.00317.55
8.0.300.0040.00418.77
8.0.290.0040.00417.30
8.0.280.0000.00718.56
8.0.270.0000.00717.23
8.0.260.0040.00417.29
8.0.250.0030.00317.09
8.0.240.0070.00017.11
8.0.230.0030.00317.02
8.0.220.0070.00017.11
8.0.210.0000.00716.98
8.0.200.0030.00317.03
8.0.190.0000.00816.96
8.0.180.0040.00416.91
8.0.170.0000.00817.04
8.0.160.0050.00216.99
8.0.150.0000.00716.84
8.0.140.0000.00716.99
8.0.130.0000.00613.37
8.0.120.0000.00816.95
8.0.110.0080.00017.10
8.0.100.0000.00817.09
8.0.90.0050.00216.92
8.0.80.0070.00716.99
8.0.70.0070.00017.05
8.0.60.0000.00717.18
8.0.50.0040.00417.13
8.0.30.0140.00617.30
8.0.20.0070.01417.40
8.0.10.0040.00417.08
8.0.00.0080.01217.02
7.4.330.0040.00415.11
7.4.320.0000.00616.74
7.4.300.0030.00316.67
7.4.290.0070.00016.74
7.4.280.0030.00316.69
7.4.270.0080.00016.77
7.4.260.0030.00316.72
7.4.250.0080.00016.70
7.4.240.0070.00016.73
7.4.230.0080.00016.82
7.4.220.0040.01316.91
7.4.210.0090.00516.83
7.4.200.0040.00416.75
7.4.190.0000.00816.75
7.4.160.0060.01116.83
7.4.150.0080.00817.40
7.4.140.0140.00617.86
7.4.130.0100.00716.75
7.4.120.0070.01116.71
7.4.110.0090.00916.79
7.4.100.0080.00916.91
7.4.90.0030.01416.88
7.4.80.0080.00819.39
7.4.70.0070.01016.71
7.4.60.0130.00316.70
7.4.50.0060.00316.55
7.4.40.0040.01116.49
7.4.30.0060.01316.62
7.4.00.0060.01115.13
7.3.330.0000.00513.23
7.3.320.0050.00213.14
7.3.310.0000.00716.36
7.3.300.0000.00716.35
7.3.290.0030.01216.34
7.3.280.0040.01416.33
7.3.270.0130.00917.40
7.3.260.0100.01316.64
7.3.250.0070.01116.57
7.3.240.0090.01016.46
7.3.230.0110.00616.43
7.3.210.0130.00616.27
7.3.200.0030.01319.39
7.3.190.0130.00916.38
7.3.180.0090.00616.69
7.3.170.0110.00516.37
7.3.160.0090.00616.27
7.3.120.0070.01014.88
7.3.110.0060.01214.53
7.3.100.0030.01014.87
7.3.90.0070.00614.92
7.3.80.0040.00914.85
7.3.70.0040.00914.91
7.3.60.0050.00614.85
7.3.50.0050.00714.90
7.3.40.0050.00914.87
7.3.30.0050.00814.80
7.3.20.0050.00916.71
7.3.10.0020.00916.47
7.3.00.0090.00516.83
7.2.330.0110.00816.77
7.2.320.0040.01416.70
7.2.310.0110.01116.71
7.2.300.0050.01116.63
7.2.290.0060.01216.76
7.2.250.0070.01115.12
7.2.240.0060.01215.11
7.2.230.0070.00715.09
7.2.220.0030.01115.13
7.2.210.0090.00414.85
7.2.200.0060.01015.08
7.2.190.0030.01015.07
7.2.180.0070.00514.97
7.2.170.0030.00914.86
7.2.160.0090.00615.17
7.2.150.0060.01016.70
7.2.140.0060.00916.95
7.2.130.0100.00316.99
7.2.120.0030.01317.11
7.2.110.0030.00716.66
7.2.100.0030.01016.84
7.2.90.0080.00817.15
7.2.80.0100.00616.99
7.2.70.0070.01016.91
7.2.60.0080.00816.86
7.2.50.0030.01017.07
7.2.40.0110.00417.05
7.2.30.0080.00417.09
7.2.20.0030.01317.17
7.2.10.0070.00717.05
7.2.00.0060.00617.09
7.1.330.0080.00715.93
7.1.320.0050.00615.84
7.1.310.0050.00715.80
7.1.300.0080.00515.68
7.1.290.0040.00815.74
7.1.280.0030.00915.79
7.1.270.0050.00515.90
7.1.260.0050.00715.85
7.1.250.0030.00915.79
7.1.240.0030.00715.73
7.1.230.0030.00715.96
7.1.220.0040.01215.77
7.1.210.0000.01416.05
7.1.200.0060.00615.84
7.1.190.0090.00315.96
7.1.180.0000.01315.68
7.1.170.0030.00715.68
7.1.160.0080.00815.86
7.1.150.0070.00415.99
7.1.140.0090.00615.70
7.1.130.0040.01115.80
7.1.120.0040.00715.97
7.1.110.0040.01116.00
7.1.100.0000.01516.06
7.1.90.0100.01015.84
7.1.80.0000.01515.93
7.1.70.0070.00416.56
7.1.60.0050.01517.67
7.1.50.0080.00616.42
7.1.40.0060.00915.66
7.1.30.0080.00415.97
7.1.20.0030.01015.93
7.1.10.0060.00615.91
7.1.00.0050.04119.15
7.0.330.0040.01115.50
7.0.320.0000.01314.93
7.0.310.0090.00015.48
7.0.300.0000.00915.51
7.0.290.0070.00715.67
7.0.280.0030.00515.25
7.0.270.0080.00415.68
7.0.260.0000.01015.34
7.0.250.0070.00415.66
7.0.240.0060.00915.72
7.0.230.0070.01315.63
7.0.220.0030.00715.66
7.0.210.0070.00315.81
7.0.200.0100.00416.29
7.0.190.0000.01415.52
7.0.180.0030.00915.67
7.0.170.0130.00015.43
7.0.160.0130.00315.46
7.0.150.0070.00315.53
7.0.140.0060.04018.70
7.0.130.0080.00515.31
7.0.120.0060.00615.59
7.0.110.0000.01315.49
7.0.100.0000.01115.57
7.0.90.0090.00615.65
7.0.80.0030.00615.66
7.0.70.0070.00715.64
7.0.60.0170.04018.53
7.0.50.0080.04316.60
7.0.40.0080.04916.79
7.0.30.0220.04216.94
7.0.20.0140.02516.79
7.0.10.0070.02116.99
7.0.00.0090.04316.76
5.6.400.0100.00014.41
5.6.390.0110.00414.21
5.6.380.0060.00914.61
5.6.370.0040.01114.49
5.6.360.0000.01714.31
5.6.350.0030.00714.36
5.6.340.0080.00814.60
5.6.330.0060.00614.50
5.6.320.0050.00914.16
5.6.310.0040.00914.24
5.6.300.0130.00014.35
5.6.290.0040.01114.06
5.6.280.0070.03717.56
5.6.270.0060.00614.45
5.6.260.0000.00914.43
5.6.250.0040.00814.47
5.6.240.0070.00714.23
5.6.230.0000.01314.61
5.6.220.0060.00614.48
5.6.210.0080.02817.40
5.6.200.0080.02116.05
5.6.190.0020.04717.46
5.6.180.0160.03017.57
5.6.170.0170.04217.47
5.6.160.0050.02317.52
5.6.150.0040.02516.24
5.6.140.0110.04016.32
5.6.130.0040.03516.19
5.6.120.0050.05017.85
5.6.110.0070.02417.64
5.6.100.0040.04517.70
5.6.90.0100.04417.85
5.6.80.0080.04517.40
5.6.70.0040.01114.13
5.6.60.0030.01414.08
5.6.50.0060.00914.57
5.6.40.0040.00414.08
5.6.30.0040.01114.27
5.6.20.0050.00414.11
5.6.10.0080.00614.18
5.6.00.0060.00614.44
5.5.380.0130.00314.03
5.5.370.0040.01214.44
5.5.360.0030.01114.36
5.5.350.0220.03217.20
5.5.340.0090.03116.09
5.5.330.0050.04817.37
5.5.320.0180.04317.33
5.5.310.0090.03817.45
5.5.300.0110.03616.14
5.5.290.0090.04016.00
5.5.280.0120.03917.67
5.5.270.0050.02617.52
5.5.260.0100.03317.56
5.5.250.0070.04217.39
5.5.240.0100.04417.24
5.5.230.0040.01114.40
5.5.220.0070.01114.05
5.5.210.0040.01213.91
5.5.200.0030.01314.23
5.5.190.0060.00914.30
5.5.180.0070.00713.98
5.5.170.0090.00314.20
5.5.160.0060.00914.07
5.5.150.0100.00314.31
5.5.140.0000.01514.02
5.5.130.0090.00614.00
5.5.120.0060.00613.77
5.5.110.0090.00614.31
5.5.100.0050.00514.39
5.5.90.0080.00313.97
5.5.80.0100.00313.92
5.5.70.0090.00614.38
5.5.60.0000.01513.83
5.5.50.0040.00713.93
5.5.40.0030.00713.99
5.5.30.0060.00913.98
5.5.20.0040.01114.47
5.5.10.0100.00314.25
5.5.00.0030.00614.28
5.4.450.2290.02515.64
5.4.440.1840.02015.74
5.4.430.1810.02115.74
5.4.420.1690.02415.63
5.4.410.1920.02015.59
5.4.400.1860.02315.55
5.4.390.1830.02715.47
5.4.380.2070.02215.47
5.4.370.1950.02515.41
5.4.360.1920.01815.48
5.4.350.1950.02315.47
5.4.340.1880.02015.53
5.4.330.0070.00211.90
5.4.320.1780.02315.47
5.4.310.2340.02215.47
5.4.300.1550.02115.54
5.4.290.1050.02015.41
5.4.280.1030.01815.53
5.4.270.1350.02815.39
5.4.260.1320.02215.53
5.4.250.1900.01715.53
5.4.240.1920.02515.51
5.4.230.2100.02315.41
5.4.220.1870.02315.41
5.4.210.1770.02115.50
5.4.200.2100.02015.53
5.4.190.2240.02015.53
5.4.180.1910.02115.58
5.4.170.2240.02015.47
5.4.160.0030.03015.38
5.4.150.0050.02315.52
5.4.140.1500.01514.01
5.4.130.1850.01914.11
5.4.120.1940.01514.07
5.4.110.2240.02114.08
5.4.100.2360.01814.19
5.4.90.1950.01514.20
5.4.80.2330.02314.18
5.4.70.2400.02014.19
5.4.60.2220.02014.18
5.4.50.0030.02014.22
5.4.40.0680.02814.13
5.4.30.2030.02014.16
5.4.20.1820.02414.19
5.4.10.2080.02314.01
5.4.00.2020.01913.81
5.3.290.2050.02013.29
5.3.280.2010.02213.15
5.3.270.2220.02113.19
5.3.260.1190.02213.15
5.3.250.0050.02313.20
5.3.240.1860.01513.21
5.3.230.2150.02313.21
5.3.220.1920.02213.20
5.3.210.2220.02213.24
5.3.200.2280.01813.20
5.3.190.2350.02213.19
5.3.180.2240.02413.13
5.3.170.2400.02813.21
5.3.160.2300.02513.20
5.3.150.0300.02313.19
5.3.140.0020.02513.21
5.3.130.1940.02413.19
5.3.120.1850.02113.13
5.3.110.2200.02313.12
5.3.100.1870.02512.88
5.3.90.2050.02012.91
5.3.80.2390.01812.95
5.3.70.2120.02012.95
5.3.60.2200.02412.91
5.3.50.2120.02012.90
5.3.40.2050.02212.82
5.3.30.1790.01912.81
5.3.20.2000.02212.77
5.3.10.1640.02112.74
5.3.00.1840.02012.74
5.2.170.3530.02711.30
5.2.160.3200.03011.30
5.2.150.3200.02711.11
5.2.140.3030.03011.13
5.2.130.3800.02311.07
5.2.120.3270.03310.96
5.2.110.3230.03311.03
5.2.100.3070.02711.25
5.2.90.3400.03311.04
5.2.80.2900.03310.93
5.2.70.3430.03310.97
5.2.60.3330.03311.05
5.2.50.3000.02710.87
5.2.40.2470.02310.96
5.2.30.2370.03010.95
5.2.20.2400.03010.94
5.2.10.2230.02010.86
5.2.00.2570.03010.75
5.1.60.2430.0239.96
5.1.50.2370.03010.00
5.1.40.2370.0279.92
5.1.30.2530.03010.38
5.1.20.2500.03010.38
5.1.10.2430.02010.14
5.1.00.2330.02310.01
5.0.50.1330.0238.38
5.0.40.1330.0178.39
5.0.30.1830.0308.21
5.0.20.1400.0238.16
5.0.10.1400.0178.21
5.0.00.1630.0338.12
4.4.90.1470.0177.04
4.4.80.1430.0207.04
4.4.70.1270.0177.04
4.4.60.1270.0107.04
4.4.50.1230.0137.04
4.4.40.1370.0277.04
4.4.30.1170.0177.04
4.4.20.1170.0177.04
4.4.10.1400.0137.04
4.4.00.1430.0237.04
4.3.110.1570.0177.04
4.3.100.1530.0177.04
4.3.90.1470.0177.04
4.3.80.1530.0307.04
4.3.70.1430.0177.04
4.3.60.1530.0137.04
4.3.50.1470.0177.04
4.3.40.1830.0277.04
4.3.30.0970.0207.04
4.3.20.0800.0177.04
4.3.10.1000.0137.04
4.3.00.0970.0237.04

preferences:
50.97 ms | 401 KiB | 5 Q