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.59
8.3.50.0140.00718.15
8.3.40.0070.01018.97
8.3.30.0060.00918.82
8.3.20.0050.00318.98
8.3.10.0000.00920.61
8.3.00.0080.00019.51
8.2.180.0110.01118.73
8.2.170.0110.00422.96
8.2.160.0080.00820.95
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0060.00326.16
8.2.120.0060.00320.97
8.2.110.0110.00622.38
8.2.100.0040.00817.97
8.2.90.0000.00917.61
8.2.80.0000.00819.09
8.2.70.0090.00017.75
8.2.60.0000.00917.75
8.2.50.0060.00317.75
8.2.40.0050.00319.60
8.2.30.0060.00318.08
8.2.20.0070.00319.73
8.2.10.0020.00517.90
8.2.00.0050.00517.94
8.1.280.0070.01425.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0070.00323.71
8.1.230.0080.00418.97
8.1.220.0000.00717.74
8.1.210.0030.00618.77
8.1.200.0100.00017.38
8.1.190.0040.00417.48
8.1.180.0030.00618.10
8.1.170.0080.00017.62
8.1.160.0040.00418.87
8.1.150.0080.00018.92
8.1.140.0070.00017.68
8.1.130.0000.00717.95
8.1.120.0050.00517.62
8.1.110.0030.00617.57
8.1.100.0040.00417.53
8.1.90.0030.00617.50
8.1.80.0000.00717.48
8.1.70.0030.00517.56
8.1.60.0030.00517.58
8.1.50.0040.00417.63
8.1.40.0060.00317.62
8.1.30.0040.00417.73
8.1.20.0000.00817.67
8.1.10.0000.00717.69
8.1.00.0000.00917.67
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0040.00418.46
8.0.270.0030.00317.32
8.0.260.0060.00016.91
8.0.250.0100.00017.10
8.0.240.0040.00417.10
8.0.230.0030.00317.04
8.0.220.0070.00017.07
8.0.210.0000.00717.13
8.0.200.0030.00316.97
8.0.190.0040.00417.08
8.0.180.0000.00817.07
8.0.170.0000.00916.83
8.0.160.0000.00716.95
8.0.150.0100.00016.94
8.0.140.0060.00316.86
8.0.130.0060.00013.47
8.0.120.0000.00716.98
8.0.110.0000.00717.06
8.0.100.0030.00617.11
8.0.90.0000.00717.02
8.0.80.0100.00617.07
8.0.70.0040.00416.93
8.0.60.0000.00717.01
8.0.50.0040.00417.11
8.0.30.0080.00817.13
8.0.20.0070.01117.25
8.0.10.0040.00417.02
8.0.00.0140.00916.96
7.4.330.0030.00313.15
7.4.320.0060.00016.86
7.4.300.0030.00316.73
7.4.290.0030.00316.64
7.4.280.0060.00616.86
7.4.270.0000.00716.86
7.4.260.0060.00013.50
7.4.250.0050.00316.63
7.4.240.0000.00916.78
7.4.230.0080.00016.85
7.4.220.0220.00716.73
7.4.210.0060.00916.79
7.4.200.0040.00416.73
7.4.190.0020.00516.87
7.4.160.0060.00916.72
7.4.150.0030.01416.73
7.4.140.0140.00416.72
7.4.130.0140.00316.75
7.4.120.0080.01116.70
7.4.110.0090.00916.64
7.4.100.0060.01616.82
7.4.90.0140.00316.71
7.4.80.0040.01819.39
7.4.70.0090.00916.62
7.4.60.0100.00716.65
7.4.50.0060.00316.67
7.4.40.0070.01016.55
7.4.30.0060.01116.64
7.4.10.0090.00915.21
7.4.00.0100.00814.83
7.3.330.0030.00313.04
7.3.320.0030.00313.04
7.3.310.0030.00316.15
7.3.300.0070.00016.29
7.3.290.0060.01016.33
7.3.280.0090.01116.35
7.3.270.0150.00916.50
7.3.260.0090.00916.65
7.3.250.0150.00716.66
7.3.240.0120.00916.72
7.3.230.0040.01216.58
7.3.210.0100.01316.40
7.3.200.0100.00616.35
7.3.190.0100.01316.48
7.3.180.0030.01316.23
7.3.170.0120.00616.59
7.3.160.0040.01316.43
7.3.130.0030.01414.58
7.3.120.0090.00914.96
7.3.110.0130.00714.53
7.3.100.0000.01415.29
7.3.90.0070.00714.74
7.3.80.0110.00315.12
7.3.70.0100.00314.71
7.3.60.0070.01014.96
7.3.50.0120.00315.02
7.3.40.0120.00314.79
7.3.30.0000.01314.98
7.3.20.0030.01016.54
7.3.10.0030.01316.57
7.3.00.0110.00316.52
7.2.330.0080.00816.77
7.2.320.0150.00916.68
7.2.310.0030.01316.71
7.2.300.0180.00916.54
7.2.290.0030.01316.60
7.2.260.0040.01414.89
7.2.250.0070.00714.96
7.2.240.0000.01414.98
7.2.230.0040.01515.17
7.2.220.0130.00315.15
7.2.210.0030.01015.00
7.2.200.0000.01715.04
7.2.190.0000.01214.77
7.2.180.0030.00915.20
7.2.170.0100.00315.07
7.2.160.0030.01015.16
7.2.150.0130.00316.99
7.2.140.0070.00717.02
7.2.130.0070.00716.84
7.2.120.0130.00316.56
7.2.110.0070.00716.73
7.2.100.0130.00316.42
7.2.90.0030.01716.52
7.2.80.0140.01216.61
7.2.70.0100.00316.58
7.2.60.0060.00816.68
7.2.50.0120.00416.81
7.2.40.0070.01016.55
7.2.30.0100.00316.45
7.2.20.0060.00616.83
7.2.10.0080.00816.78
7.2.00.0000.01416.79
7.1.330.0050.00815.77
7.1.320.0040.01215.76
7.1.310.0110.00415.91
7.1.300.0070.00715.91
7.1.290.0040.00716.14
7.1.280.0040.00415.86
7.1.270.0090.00615.52
7.1.260.0030.01015.46
7.1.250.0110.00015.76
7.1.240.0130.00315.54
7.1.230.0100.00715.69
7.1.220.0130.00015.65
7.1.210.0110.00615.77
7.1.200.0050.00615.75
7.1.190.0040.01115.68
7.1.180.0030.01315.35
7.1.170.0000.00915.75
7.1.160.0100.00015.21
7.1.150.0050.00815.66
7.1.140.0100.00315.89
7.1.130.0040.00715.73
7.1.120.0080.00515.68
7.1.110.0030.00915.53
7.1.100.0080.00815.71
7.1.90.0070.00415.75
7.1.80.0080.00615.45
7.1.70.0090.00216.42
7.1.60.0130.00617.48
7.1.50.0070.00716.30
7.1.40.0040.00715.58
7.1.30.0030.00615.53
7.1.20.0060.00915.63
7.1.10.0100.01015.58
7.1.00.0070.04019.04
7.0.330.0030.00715.08
7.0.320.0100.00715.29
7.0.310.0000.01515.29
7.0.300.0040.00415.41
7.0.290.0090.00615.11
7.0.280.0090.00915.09
7.0.270.0100.00315.00
7.0.260.0000.00815.01
7.0.250.0030.00915.31
7.0.240.0000.01315.55
7.0.230.0130.00015.32
7.0.220.0080.00415.22
7.0.210.0090.00315.29
7.0.200.0080.00715.90
7.0.190.0040.00815.12
7.0.180.0000.01115.18
7.0.170.0110.00014.88
7.0.160.0000.01615.21
7.0.150.0080.00615.43
7.0.140.0030.04218.58
7.0.130.0080.00815.50
7.0.120.0070.04018.62
7.0.110.0160.00015.34
7.0.100.0030.01015.61
7.0.90.0030.00915.17
7.0.80.0110.00415.58
7.0.70.0100.00315.29
7.0.60.0070.04518.51
7.0.50.0040.04716.68
7.0.40.0080.04516.85
7.0.30.0070.05116.92
7.0.20.0130.03816.74
7.0.10.0050.03616.77
7.0.00.0090.04316.97
5.6.400.0090.00614.71
5.6.390.0070.01013.95
5.6.380.0060.00913.82
5.6.370.0030.01214.16
5.6.360.0050.00513.98
5.6.350.0090.00614.04
5.6.340.0100.00014.19
5.6.330.0040.00914.14
5.6.320.0120.00614.01
5.6.310.0030.01314.02
5.6.300.0100.00714.07
5.6.290.0030.01013.92
5.6.280.0040.00814.37
5.6.270.0040.00714.07
5.6.260.0080.00814.19
5.6.250.0040.01114.38
5.6.240.0100.00014.21
5.6.230.0070.01014.71
5.6.220.0030.00614.19
5.6.210.0080.03817.44
5.6.200.0100.04216.20
5.6.190.0090.02217.44
5.6.180.0200.03817.50
5.6.170.0200.04217.27
5.6.160.0090.04317.37
5.6.150.0100.04316.28
5.6.140.0090.04116.23
5.6.130.0080.04416.29
5.6.120.0070.04117.63
5.6.110.0020.02717.66
5.6.100.0030.04517.61
5.6.90.0100.04517.61
5.6.80.0070.02617.28
5.6.70.0080.00614.32
5.6.60.0060.00314.31
5.6.50.0070.00714.25
5.6.40.0060.00914.07
5.6.30.0030.00613.98
5.6.20.0030.00714.26
5.6.10.0090.00414.55
5.6.00.0090.00614.36
5.5.380.0080.00414.16
5.5.370.0040.00414.24
5.5.360.0040.01114.32
5.5.350.0060.04317.39
5.5.340.0060.02616.30
5.5.330.0040.04717.43
5.5.320.0180.03917.24
5.5.310.0180.04017.38
5.5.300.0030.03416.09
5.5.290.0050.03816.16
5.5.280.0030.04517.50
5.5.270.0030.04817.60
5.5.260.0150.03917.55
5.5.250.0050.02417.48
5.5.240.0130.04117.13
5.5.230.0090.00614.29
5.5.220.0040.01114.30
5.5.210.0000.01414.18
5.5.200.0110.00414.18
5.5.190.0070.01314.32
5.5.180.0000.01313.84
5.5.170.0030.00614.36
5.5.160.0140.00314.05
5.5.150.0070.00314.22
5.5.140.0040.01114.20
5.5.130.0090.00614.30
5.5.120.0090.00614.16
5.5.110.0090.00314.14
5.5.100.0000.01514.34
5.5.90.0030.01014.36
5.5.80.0060.00914.09
5.5.70.0070.01014.37
5.5.60.0070.00714.35
5.5.50.0110.00014.32
5.5.40.0090.00014.20
5.5.30.0070.01014.04
5.5.20.0030.01014.40
5.5.10.0000.01014.16
5.5.00.0060.00913.83
5.4.450.0030.02415.21
5.4.440.0070.03815.26
5.4.430.0020.02715.32
5.4.420.0020.02715.27
5.4.410.0070.02715.16
5.4.400.0050.02315.08
5.4.390.0050.01915.12
5.4.380.0060.02015.03
5.4.370.0000.02415.12
5.4.360.0000.02415.07
5.4.350.0050.02014.82
5.4.340.0020.02415.09
5.4.330.0030.00610.99
5.4.320.0030.02115.12
5.4.310.0030.02314.94
5.4.300.0030.02214.74
5.4.290.0030.02315.08
5.4.280.0050.02215.01
5.4.270.0030.02315.08
5.4.260.0050.02015.03
5.4.250.0050.01815.06
5.4.240.0050.02315.10
5.4.230.0020.02215.01
5.4.220.0050.02015.02
5.4.210.0070.01714.97
5.4.200.0070.02014.99
5.4.190.0050.02014.94
5.4.180.0050.02014.97
5.4.170.0030.02315.12
5.4.160.0070.01714.94
5.4.150.0020.04415.00
5.4.140.0040.02413.70
5.4.130.0030.02813.71
5.4.120.0070.03513.57
5.4.110.0020.02913.65
5.4.100.0090.03713.77
5.4.90.0100.03513.81
5.4.80.0080.03713.50
5.4.70.0050.03813.53
5.4.60.0050.04113.68
5.4.50.0020.03213.62
5.4.40.0080.03613.54
5.4.30.0060.02513.54
5.4.20.0090.03513.69
5.4.10.0080.03313.60
5.4.00.0000.03313.36
5.3.290.0080.02212.57
5.3.280.0000.02512.46
5.3.270.0020.02212.43
5.3.260.0040.02312.48
5.3.250.0020.03112.39
5.3.240.0020.02212.37
5.3.230.0030.02212.35
5.3.220.0080.02312.42
5.3.210.0020.03812.39
5.3.200.0030.03712.51
5.3.190.0020.04012.44
5.3.180.0030.04612.41
5.3.170.0050.03512.52
5.3.160.0030.04012.40
5.3.150.0050.04312.44
5.3.140.0070.03812.51
5.3.130.0050.04412.53
5.3.120.0050.04012.40
5.3.110.0100.02512.49
5.3.100.0030.03212.21
5.3.90.0030.02412.24
5.3.80.0110.03312.20
5.3.70.0050.04012.13
5.3.60.0030.03512.21
5.3.50.0030.02612.13
5.3.40.0070.02712.06
5.3.30.0060.02012.14
5.3.20.0030.02112.02
5.3.10.0060.02011.91
5.3.00.0030.04011.94
5.2.170.0030.03011.13
5.2.160.0030.06311.12
5.2.150.0030.03711.03
5.2.140.0070.04010.96
5.2.130.0030.03311.00
5.2.120.0100.04311.05
5.2.110.0100.03711.25
5.2.100.0070.04011.09
5.2.90.0070.05710.93
5.2.80.0100.06010.99
5.2.70.0100.05711.02
5.2.60.0100.05710.97
5.2.50.0030.05710.89
5.2.40.0100.05710.87
5.2.30.0030.03010.98
5.2.20.0070.03010.91
5.2.10.0000.03310.76
5.2.00.0070.04010.74
5.1.60.0030.0379.96
5.1.50.0070.0439.89
5.1.40.0000.04710.04
5.1.30.0070.05310.34
5.1.20.0000.04710.50
5.1.10.0030.04310.03
5.1.00.0130.04710.04
5.0.50.0070.0238.57
5.0.40.0030.0208.38
5.0.30.0000.0338.12
5.0.20.0070.0438.10
5.0.10.0000.0238.17
5.0.00.0070.0278.13
4.4.90.0000.0377.73
4.4.80.0070.0337.73
4.4.70.0000.0207.73
4.4.60.0070.0177.73
4.4.50.0000.0377.73
4.4.40.0000.0477.73
4.4.30.0070.0377.73
4.4.20.0070.0307.73
4.4.10.0000.0277.73
4.4.00.0000.0437.73
4.3.110.0030.0137.73
4.3.100.0000.0407.73
4.3.90.0000.0237.73
4.3.80.0030.0537.73
4.3.70.0030.0137.73
4.3.60.0000.0177.73
4.3.50.0070.0237.73
4.3.40.0030.0477.73
4.3.30.0000.0407.73
4.3.20.0030.0337.73
4.3.10.0030.0207.73
4.3.00.0000.0207.73

preferences:
48.99 ms | 401 KiB | 5 Q