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 ? $result= 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 ? echo preg_replace('/\xE0[\x80-\x9F][\x80-\xBF]'. '|\xED[\xA0-\xBF][\x80-\xBF]/S','', $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.0110.00418.43
8.3.50.0130.00722.09
8.3.40.0110.00718.97
8.3.30.0110.00419.09
8.3.20.0040.00420.21
8.3.10.0040.00423.48
8.3.00.0000.00720.64
8.2.180.0110.00716.62
8.2.170.0100.01022.96
8.2.160.0070.00722.26
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0030.00522.20
8.2.110.0040.00422.23
8.2.100.0200.00018.03
8.2.90.0040.00419.18
8.2.80.0080.00017.97
8.2.70.0090.00017.63
8.2.60.0040.00417.93
8.2.50.0100.00018.07
8.2.40.0000.00819.38
8.2.30.0000.00718.16
8.2.20.0000.00717.86
8.2.10.0000.00817.98
8.2.00.0060.00318.03
8.1.280.0080.00625.92
8.1.270.0050.00323.82
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00623.92
8.1.230.0070.00419.14
8.1.220.0030.00517.91
8.1.210.0040.00418.77
8.1.200.0040.00717.48
8.1.190.0040.00417.39
8.1.180.0000.00818.10
8.1.170.0040.00418.63
8.1.160.0040.00422.04
8.1.150.0050.00218.70
8.1.140.0050.00217.59
8.1.130.0050.00218.00
8.1.120.0000.00717.41
8.1.110.0040.00417.46
8.1.100.0040.00417.53
8.1.90.0000.00817.60
8.1.80.0030.00317.50
8.1.70.0000.00717.56
8.1.60.0050.00317.70
8.1.50.0090.00017.60
8.1.40.0000.00817.63
8.1.30.0060.00317.75
8.1.20.0080.00017.70
8.1.10.0030.00517.64
8.1.00.0000.00817.61
8.0.300.0000.00718.77
8.0.290.0040.00417.17
8.0.280.0000.00718.40
8.0.270.0030.00317.31
8.0.260.0070.00317.02
8.0.250.0000.00817.01
8.0.240.0070.00017.04
8.0.230.0030.00316.97
8.0.220.0070.00016.98
8.0.210.0000.00717.03
8.0.200.0060.00017.05
8.0.190.0000.00717.08
8.0.180.0040.00417.05
8.0.170.0040.00417.08
8.0.160.0000.00816.89
8.0.150.0000.00716.96
8.0.140.0040.00416.86
8.0.130.0000.00613.42
8.0.120.0000.00817.01
8.0.110.0000.00717.05
8.0.100.0000.00717.02
8.0.90.0000.00717.15
8.0.80.0090.00616.96
8.0.70.0040.00416.93
8.0.60.0050.00317.06
8.0.50.0040.00417.06
8.0.30.0080.01417.45
8.0.20.0080.01117.46
8.0.10.0000.00717.05
8.0.00.0120.00816.88
7.4.330.0060.00015.00
7.4.320.0030.00316.75
7.4.300.0000.00716.73
7.4.290.0000.00716.84
7.4.280.0040.00416.78
7.4.270.0060.00616.78
7.4.260.0030.00316.79
7.4.250.0030.00316.82
7.4.240.0020.00616.79
7.4.230.0040.00416.90
7.4.220.0110.00716.86
7.4.210.0060.01516.77
7.4.200.0080.00016.84
7.4.190.0000.00716.49
7.4.160.0060.00916.63
7.4.150.0070.01317.40
7.4.140.0120.00817.86
7.4.130.0050.01216.82
7.4.120.0090.00816.64
7.4.110.0090.00916.51
7.4.100.0080.01316.58
7.4.90.0300.03116.57
7.4.80.0070.01116.79
7.4.70.0170.00316.72
7.4.60.0100.00716.52
7.4.50.0050.00316.50
7.4.40.0090.00922.77
7.4.30.0060.00916.77
7.4.10.0070.00714.97
7.4.00.0120.00515.23
7.3.330.0060.00013.05
7.3.320.0000.00513.01
7.3.310.0000.00716.13
7.3.300.0070.00016.14
7.3.290.0120.00316.30
7.3.280.0110.00816.29
7.3.270.0100.00717.40
7.3.260.0150.00316.59
7.3.250.0060.01516.52
7.3.240.0100.00716.52
7.3.230.0060.01016.39
7.3.210.0070.01616.41
7.3.200.0110.00719.39
7.3.190.0100.01016.68
7.3.180.0060.01416.39
7.3.170.0030.01316.27
7.3.160.0080.00816.50
7.3.130.0060.00914.66
7.3.120.0050.01214.73
7.3.110.0090.00914.80
7.3.100.0100.00614.96
7.3.90.0070.00714.98
7.3.80.0030.00614.85
7.3.70.0060.00614.94
7.3.60.0030.00714.67
7.3.50.0060.01014.95
7.3.40.0060.01014.80
7.3.30.0030.00914.66
7.3.20.0060.00916.50
7.3.10.0030.00716.38
7.3.00.0060.00916.77
7.2.330.0070.01116.75
7.2.320.0120.00716.66
7.2.310.0060.01116.62
7.2.300.0120.00616.63
7.2.290.0000.01616.71
7.2.260.0030.01315.19
7.2.250.0060.00915.24
7.2.240.0000.01415.26
7.2.230.0070.00715.21
7.2.220.0040.00714.93
7.2.210.0000.01015.17
7.2.200.0000.01415.19
7.2.190.0040.01415.05
7.2.180.0090.00915.22
7.2.170.0070.00715.23
7.2.160.0040.00714.82
7.2.150.0030.01017.02
7.2.140.0070.00417.08
7.2.130.0040.01216.78
7.2.120.0000.01217.09
7.2.110.0070.01016.84
7.2.100.0090.00616.85
7.2.90.0040.01117.13
7.2.80.0030.00716.98
7.2.70.0060.00916.83
7.2.60.0050.00516.96
7.2.50.0110.00017.04
7.2.40.0000.00916.74
7.2.30.0090.00617.16
7.2.20.0040.01517.16
7.2.10.0090.00316.98
7.2.00.0030.01018.30
7.1.330.0110.00315.89
7.1.320.0000.00915.81
7.1.310.0130.00315.91
7.1.300.0040.01215.98
7.1.290.0120.00615.89
7.1.280.0040.01115.88
7.1.270.0070.00715.98
7.1.260.0070.01015.67
7.1.250.0130.00315.77
7.1.240.0130.00015.65
7.1.230.0070.01015.69
7.1.220.0080.00816.05
7.1.210.0000.01115.70
7.1.200.0040.01215.89
7.1.190.0100.00315.85
7.1.180.0040.00815.94
7.1.170.0000.01515.74
7.1.160.0040.01115.71
7.1.150.0100.01015.93
7.1.140.0070.00715.78
7.1.130.0040.01115.97
7.1.120.0120.00315.58
7.1.110.0030.00616.03
7.1.100.0040.00917.16
7.1.90.0030.00615.82
7.1.80.0000.01415.66
7.1.70.0030.00916.57
7.1.60.0110.00817.47
7.1.50.0080.00716.38
7.1.40.0110.00616.05
7.1.30.0030.00615.65
7.1.20.0040.00815.95
7.1.10.0000.01515.95
7.1.00.0030.04219.00
7.0.330.0000.01115.75
7.0.320.0070.01015.62
7.0.310.0070.00715.60
7.0.300.0090.00615.59
7.0.290.0060.00315.53
7.0.280.0140.00315.59
7.0.270.0030.01515.51
7.0.260.0060.00315.64
7.0.250.0030.00615.79
7.0.240.0040.01115.45
7.0.230.0030.01015.52
7.0.220.0040.00915.50
7.0.210.0060.00915.49
7.0.200.0050.00716.19
7.0.190.0070.00715.54
7.0.180.0040.01115.68
7.0.170.0100.00615.54
7.0.160.0090.00615.54
7.0.150.0070.00715.38
7.0.140.0020.04318.92
7.0.130.0090.00315.27
7.0.120.0040.01115.41
7.0.110.0040.00715.45
7.0.100.0000.04717.79
7.0.90.0060.02517.76
7.0.80.0080.04217.59
7.0.70.0070.03717.66
7.0.60.0180.04017.54
7.0.50.0120.04017.99
7.0.40.0030.02616.90
7.0.30.0070.04416.63
7.0.20.0070.02416.82
7.0.10.0020.03016.90
7.0.00.0050.02516.74
5.6.400.0060.00913.98
5.6.390.0090.00014.65
5.6.380.0060.01214.45
5.6.370.0060.00914.61
5.6.360.0000.01414.64
5.6.350.0030.01314.34
5.6.340.0030.01014.21
5.6.330.0120.00614.54
5.6.320.0000.01214.59
5.6.310.0120.00314.34
5.6.300.0030.01214.27
5.6.290.0090.00314.45
5.6.280.0110.03217.67
5.6.270.0060.00614.54
5.6.260.0060.00614.16
5.6.250.0080.02617.71
5.6.240.0100.04017.48
5.6.230.0060.04717.44
5.6.220.0060.04517.41
5.6.210.0060.03917.52
5.6.200.0120.04017.70
5.6.190.0080.04017.74
5.6.180.0100.02317.67
5.6.170.0070.02817.83
5.6.160.0030.02717.81
5.6.150.0050.02117.69
5.6.140.0080.02017.60
5.6.130.0070.02717.68
5.6.120.0060.03817.82
5.6.110.0110.02017.66
5.6.100.0050.02617.66
5.6.90.0020.04617.56
5.6.80.0070.02317.40
5.6.70.0040.02417.28
5.6.60.0050.02117.33
5.6.50.0030.02617.21
5.6.40.0040.02917.49
5.6.30.0070.02417.46
5.6.20.0060.02317.46
5.6.10.0100.02017.40
5.6.00.0030.02317.27
5.5.380.0070.04117.31
5.5.370.0060.04117.36
5.5.360.0060.04417.23
5.5.350.0060.02817.42
5.5.340.0080.04017.49
5.5.330.0050.02917.69
5.5.320.0050.02817.57
5.5.310.0110.02117.53
5.5.300.0030.02417.56
5.5.290.0080.02517.35
5.5.280.0050.02317.58
5.5.270.0030.02517.47
5.5.260.0030.03717.57
5.5.250.0100.02117.43
5.5.240.0070.04217.26
5.5.230.0050.02817.19
5.5.220.0070.02217.06
5.5.210.0070.02317.08
5.5.200.0070.02317.08
5.5.190.0050.02417.28
5.5.180.0070.02217.12
5.5.170.0000.01014.16
5.5.160.0040.02717.23
5.5.150.0080.02317.25
5.5.140.0050.02517.18
5.5.130.0050.02317.23
5.5.120.0070.02117.27
5.5.110.0020.02817.34
5.5.100.0080.02417.11
5.5.90.0110.01817.15
5.5.80.0080.02017.19
5.5.70.0020.02617.01
5.5.60.0090.01817.14
5.5.50.0060.02317.14
5.5.40.0050.02817.04
5.5.30.0020.04417.09
5.5.20.0030.02817.18
5.5.10.0090.03817.15
5.5.00.0130.03317.16
5.4.450.0020.02715.19
5.4.440.0050.02315.37
5.4.430.0050.02215.26
5.4.420.0030.02515.24
5.4.410.0020.02915.06
5.4.400.0110.03315.19
5.4.390.0040.02015.04
5.4.380.0030.02115.12
5.4.370.0090.01515.04
5.4.360.0070.01814.94
5.4.350.0050.02015.03
5.4.340.0010.02414.94
5.4.330.0070.00710.95
5.4.320.0000.02614.84
5.4.310.0020.02214.76
5.4.300.0070.03514.94
5.4.290.0050.02214.94
5.4.280.0020.02315.04
5.4.270.0030.02214.97
5.4.260.0040.02515.14
5.4.250.0020.02515.08
5.4.240.0070.01814.96
5.4.230.0000.02814.92
5.4.220.0030.02714.96
5.4.210.0070.02315.05
5.4.200.0070.01915.04
5.4.190.0050.03815.06
5.4.180.0050.03714.95
5.4.170.0080.03814.93
5.4.160.0050.03715.20
5.4.150.0050.04015.01
5.4.140.0040.04013.85
5.4.130.0050.04013.73
5.4.120.0050.04213.71
5.4.110.0050.04213.66
5.4.100.0140.03313.56
5.4.90.0060.03513.71
5.4.80.0060.03813.66
5.4.70.0040.04013.60
5.4.60.0070.03513.53
5.4.50.0060.03813.71
5.4.40.0070.03713.79
5.4.30.0020.02513.56
5.4.20.0080.02813.51
5.4.10.0070.03213.59
5.4.00.0080.03613.42
5.3.290.0010.02312.62
5.3.280.0030.02312.51
5.3.270.0110.03512.54
5.3.260.0070.03712.54
5.3.250.0030.03612.46
5.3.240.0050.03812.38
5.3.230.0080.01712.46
5.3.220.0120.03512.45
5.3.210.0040.03412.46
5.3.200.0060.04012.44
5.3.190.0050.04012.51
5.3.180.0090.02612.45
5.3.170.0050.04012.43
5.3.160.0090.04012.36
5.3.150.0020.04012.51
5.3.140.0120.02012.44
5.3.130.0050.03112.50
5.3.120.0050.04212.55
5.3.110.0030.04212.41
5.3.100.0020.03512.23
5.3.90.0050.02012.20
5.3.80.0050.03812.09
5.3.70.0080.03612.06
5.3.60.0030.03712.06
5.3.50.0060.03812.06
5.3.40.0050.02812.08
5.3.30.0070.04012.03
5.3.20.0020.02512.01
5.3.10.0010.03411.89
5.3.00.0000.02411.86
5.2.170.0070.06011.13
5.2.160.0070.06010.94
5.2.150.0070.03311.13
5.2.140.0030.05710.95
5.2.130.0000.05310.94
5.2.120.0100.05710.89
5.2.110.0070.05310.98
5.2.100.0100.03711.13
5.2.90.0100.05311.05
5.2.80.0100.05711.09
5.2.70.0000.04710.91
5.2.60.0000.03710.87
5.2.50.0130.05710.98
5.2.40.0030.04010.87
5.2.30.0030.05710.77
5.2.20.0030.03310.80
5.2.10.0000.06010.79
5.2.00.0070.05310.75
5.1.60.0000.0579.83
5.1.50.0000.05710.02
5.1.40.0030.0279.96
5.1.30.0000.06010.25
5.1.20.0070.03010.37
5.1.10.0030.0579.90
5.1.00.0030.05710.06
5.0.50.0030.0408.42
5.0.40.0030.0238.45
5.0.30.0070.0608.24
5.0.20.0070.0438.19
5.0.10.0100.0238.22
5.0.00.0030.0678.17
4.4.90.0000.0208.17
4.4.80.0030.0338.17
4.4.70.0000.0338.17
4.4.60.0070.0278.17
4.4.50.0000.0308.17
4.4.40.0000.0308.17
4.4.30.0000.0308.17
4.4.20.0070.0338.17
4.4.10.0070.0138.17
4.4.00.0030.0538.17
4.3.110.0030.0378.17
4.3.100.0100.0108.17
4.3.90.0000.0438.17
4.3.80.0100.0478.17
4.3.70.0000.0338.17
4.3.60.0000.0338.17
4.3.50.0070.0338.17
4.3.40.0000.0508.17
4.3.30.0030.0338.17
4.3.20.0000.0408.17
4.3.10.0030.0338.17
4.3.00.0000.0378.17

preferences:
43.69 ms | 401 KiB | 5 Q