3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "\x95\xB6\x8E\x9A\x83\x52\x81\x5B\x83\x68"; // Detect character encoding with current detect_order var_dump(mb_detect_encoding($str)); // "auto" is expanded according to mbstring.language var_dump(mb_detect_encoding($str, "auto")); // Specify "encodings" parameter by list separated by comma var_dump(mb_detect_encoding($str, "JIS, eucjp-win, sjis-win")); // Use array to specify "encodings" parameter $encodings = [ "ASCII", "JIS", "EUC-JP" ]; var_dump(mb_detect_encoding($str, $encodings));

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.5.00.0120.01019.82
8.4.150.0020.00114.05
8.4.140.0150.00817.96
8.4.130.0160.00517.69
8.4.120.0090.00920.58
8.4.110.0120.00722.23
8.4.100.0130.00717.45
8.4.90.0140.00618.45
8.4.80.0120.00817.45
8.4.70.0160.00517.50
8.4.60.0150.00617.47
8.4.50.0090.01019.33
8.4.40.0340.00919.05
8.4.30.0400.00717.34
8.4.20.0530.00617.21
8.4.10.0460.00317.21
8.3.280.0130.00718.69
8.3.270.0120.00816.48
8.3.260.0110.00916.38
8.3.250.0060.00318.89
8.3.240.0100.01316.80
8.3.230.0120.00816.41
8.3.220.0030.00419.13
8.3.210.0140.00516.79
8.3.200.0140.00516.74
8.3.190.0090.00816.57
8.3.180.0100.00816.48
8.3.170.0420.00316.40
8.3.160.0380.00716.28
8.3.150.0340.01116.21
8.3.140.0380.00816.20
8.3.130.0380.00316.52
8.3.120.0350.00616.52
8.3.110.0400.00016.43
8.3.100.0420.00716.36
8.3.90.0300.00016.24
8.3.80.0240.00516.21
8.3.70.0300.01016.46
8.3.60.0260.00016.46
8.3.50.0380.00316.16
8.3.40.0320.01817.29
8.3.30.0270.00617.13
8.3.20.0240.01217.34
8.3.10.0320.00417.15
8.3.00.0160.00517.32
8.2.290.0120.00320.40
8.2.280.0080.01122.23
8.2.270.0300.01316.79
8.2.260.0330.00316.48
8.2.250.0300.00716.35
8.2.240.0350.00416.42
8.2.230.0330.00616.46
8.2.220.0370.00316.82
8.2.210.0310.00616.40
8.2.200.0340.00716.64
8.2.190.0240.00516.69
8.2.180.0280.00716.56
8.2.170.0320.00417.91
8.2.160.0310.00017.70
8.2.150.0220.01617.52
8.2.140.0330.00717.66
8.2.130.0340.00617.60
8.2.120.0310.00917.69
8.2.110.0370.00017.81
8.2.100.0310.01017.52
8.2.90.0260.00717.56
8.2.80.0350.00617.73
8.2.70.0330.00717.50
8.2.60.0310.00617.70
8.2.50.0270.01217.71
8.2.40.0290.00317.53
8.2.30.0250.01317.74
8.2.20.0330.01017.66
8.2.10.0330.00717.53
8.2.00.0310.00317.41
8.1.320.0090.01016.05

preferences:
38.61 ms | 403 KiB | 5 Q