3v4l.org

run code in 300+ PHP versions simultaneously
<?php // This returns as expected. $str = "\xf8foo"; var_dump( mb_detect_encoding($str, 'UTF-8'), // bool(false) mb_detect_encoding($str, 'UTF-8', true) // bool(false) ); // This does not. $str = "foo\xf8"; var_dump( mb_detect_encoding($str, 'UTF-8'), // string(5) "UTF-8" mb_detect_encoding($str, 'UTF-8', true) // bool(false) ); // Nor does this. $str = "\xe1\xe9\xf3\xfa"; var_dump( mb_detect_encoding($str, 'UTF-8'), // string(5) "UTF-8" mb_detect_encoding($str, 'UTF-8', true) // bool(false) );

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.50
8.3.50.0060.00917.94
8.3.40.0090.00918.51
8.3.30.0140.00418.43
8.3.20.0060.00320.61
8.3.10.0040.00421.91
8.3.00.0050.00320.54
8.2.180.0140.00316.75
8.2.170.0120.00322.96
8.2.160.0080.00521.07
8.2.150.0000.00824.18
8.2.140.0060.00324.66
8.2.130.0020.00522.13
8.2.120.0070.00026.35
8.2.110.0000.01019.27
8.2.100.0080.00317.78
8.2.90.0060.00319.22
8.2.80.0110.00017.97
8.2.70.0000.00817.49
8.2.60.0030.00518.04
8.2.50.0030.00618.10
8.2.40.0050.00222.37
8.2.30.0000.00719.25
8.2.20.0080.00017.52
8.2.10.0050.00218.12
8.2.00.0000.00717.88
8.1.280.0060.01525.92
8.1.270.0080.00023.79
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0100.00019.39
8.1.230.0060.00617.46
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0030.00617.25
8.1.190.0050.00317.23
8.1.180.0040.00418.10
8.1.170.0030.00518.64
8.1.160.0030.00322.16
8.1.150.0000.00918.78
8.1.140.0000.00819.55
8.1.130.0040.00417.64
8.1.120.0000.00717.38
8.1.110.0000.00717.48
8.1.100.0020.00517.34
8.1.90.0050.00217.46
8.1.80.0040.00417.49
8.1.70.0070.00017.45
8.1.60.0030.00617.62
8.1.50.0040.00417.55
8.1.40.0030.00717.43
8.1.30.0030.00617.74
8.1.20.0000.00817.49
8.1.10.0050.00217.52
8.1.00.0080.00017.47
8.0.300.0080.00018.77
8.0.290.0050.00316.75
8.0.280.0040.00418.47
8.0.270.0070.00017.32
8.0.260.0000.00717.32
8.0.250.0070.00016.97
8.0.240.0030.00316.97
8.0.230.0040.00416.95
8.0.220.0080.00016.86
8.0.210.0030.00316.93
8.0.200.0060.00017.02
8.0.190.0000.00716.95
8.0.180.0110.00016.91
8.0.170.0070.00016.99
8.0.160.0000.00716.82
8.0.150.0030.00616.73
8.0.140.0000.01116.90
8.0.130.0060.00013.23
8.0.120.0040.00416.86
8.0.110.0060.00316.79
8.0.100.0000.00716.70
8.0.90.0040.00416.74
8.0.80.0070.01016.87
8.0.70.0030.00516.95
8.0.60.0040.00416.86
8.0.50.0070.00016.86
8.0.30.0080.00916.91
8.0.20.0120.00817.40
8.0.10.0030.00517.03
8.0.00.0100.01316.58
7.4.330.0060.00015.08
7.4.320.0030.00316.42
7.4.300.0000.00616.50
7.4.290.0000.00716.46
7.4.280.0000.00716.41
7.4.270.0030.00316.60
7.4.260.0070.00016.45
7.4.250.0030.00316.40
7.4.240.0040.00416.44
7.4.230.0000.00716.50
7.4.220.0130.01316.39
7.4.210.0070.00716.46
7.4.200.0000.00716.51
7.4.160.0100.00716.42
7.4.150.0100.01617.40
7.4.140.0070.01017.86
7.4.130.0100.00816.60
7.4.120.0110.00516.46
7.4.110.0090.01216.51
7.4.100.0110.00916.44
7.4.90.0140.00316.43
7.4.80.0130.00719.39
7.4.70.0120.00616.46
7.4.60.0150.00416.50
7.4.50.0070.00716.32
7.4.40.0070.01016.48
7.4.30.0090.00916.46
7.4.00.0000.01014.86
7.3.330.0000.00613.14
7.3.320.0000.00512.95
7.3.310.0000.00816.26
7.3.300.0000.00716.25
7.3.290.0050.00916.21
7.3.280.0100.00716.24
7.3.270.0110.00617.40
7.3.260.0130.00716.16
7.3.250.0080.01016.37
7.3.240.0050.01116.37
7.3.230.0100.00616.39
7.3.210.0120.00616.47
7.3.200.0110.00616.53
7.3.190.0090.00916.30
7.3.180.0150.00616.09
7.3.170.0040.01516.42
7.3.160.0110.01116.20
7.3.120.0030.01414.67
7.3.110.0070.00714.78
7.3.100.0030.00914.77
7.3.90.0060.00914.65
7.3.80.0030.01314.40
7.3.70.0070.00714.42
7.3.60.0100.00714.64
7.3.50.0070.00714.84
7.3.40.0040.01414.47
7.3.30.0060.00314.62
7.3.20.0090.00616.46
7.3.10.0080.00816.51
7.3.00.0090.00516.48
7.2.330.0160.00516.50
7.2.320.0090.01216.40
7.2.310.0060.01016.47
7.2.300.0130.00316.46
7.2.290.0090.01216.42
7.2.240.0070.01114.79
7.2.230.0030.01314.87
7.2.220.0030.01014.75
7.2.210.0030.00914.89
7.2.200.0040.01514.79
7.2.190.0080.00314.77
7.2.180.0000.00814.77
7.2.170.0090.00614.55
7.2.160.0090.00614.84
7.2.150.0060.00916.84
7.2.140.0030.01016.76
7.2.130.0070.00716.59
7.2.120.0050.00816.57
7.2.110.0060.00816.62
7.2.100.0100.00516.49
7.2.90.0110.00516.48
7.2.80.0100.00616.47
7.2.70.0080.01016.79
7.2.60.0070.00716.56
7.2.50.0060.00716.77
7.2.40.0070.00816.56
7.2.30.0050.01016.77
7.2.20.0050.00616.78
7.2.10.0020.01116.63
7.2.00.0060.00817.42
7.1.330.0000.01115.61
7.1.320.0080.00615.90
7.1.310.0040.01415.73
7.1.300.0080.00815.60
7.1.290.0060.00815.50
7.1.280.0100.00715.66
7.1.270.0040.01115.80
7.1.260.0070.01115.77
7.1.250.0070.00415.76
7.1.200.0070.00415.71
7.1.70.0000.01117.12
7.1.60.0370.00615.24
7.1.00.0030.07722.30
7.0.200.0030.01016.70
7.0.100.0070.05719.97
7.0.90.0100.06320.05
7.0.80.0200.04720.21
7.0.70.0100.06019.93
7.0.60.0130.06720.01
7.0.50.0100.06020.38
7.0.40.0100.06020.33
7.0.30.0270.04720.34
7.0.20.0130.05320.46
7.0.10.0100.05720.29
7.0.00.0070.06320.35
5.6.250.0170.05720.66
5.6.240.0170.05020.73
5.6.230.0100.06020.57
5.6.220.0170.05320.77
5.6.210.0070.06020.55
5.6.200.0030.06721.20
5.6.190.0070.05721.05
5.6.180.0030.06321.10
5.6.170.0000.06321.13
5.6.160.0200.05021.11
5.6.150.0030.07721.08
5.6.140.0170.05021.17
5.6.130.0030.06321.12
5.6.120.0100.06021.12
5.6.110.0130.05721.07
5.6.100.0030.06321.05
5.6.90.0000.06721.18
5.6.80.0170.04720.49
5.6.70.0170.05720.43
5.6.60.0070.05320.39
5.6.50.0100.05020.45
5.6.40.0070.05720.55
5.6.30.0030.05720.37
5.6.20.0070.05720.42
5.6.10.0070.05720.42
5.6.00.0130.05020.52

preferences:
67.86 ms | 401 KiB | 5 Q