3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str1 = '14'; $str2 = 'DQ'; $encodings1 = ['ASCII', 'UTF-8', 'UTF-16', 'UTF-16LE']; $encodings2 = ['UTF-8', 'UTF-16', 'UTF-16LE']; echo bin2hex($str1) . ' - ' . mb_detect_encoding($str1, $encodings1, true)."\n"; echo bin2hex($str1) . ' - ' . mb_detect_encoding($str1, $encodings2, true)."\n"; echo bin2hex($str2) . ' - ' . mb_detect_encoding($str2, $encodings1, true)."\n"; echo bin2hex($str2) . ' - ' . mb_detect_encoding($str2, $encodings2, true)."\n";

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.4.130.0110.00718.70
8.4.120.0110.00924.25
8.4.110.0100.01022.16
8.4.100.0040.00518.45
8.4.90.0130.00718.80
8.4.80.0120.00820.54
8.4.70.0130.00817.79
8.4.60.0150.00618.82
8.4.50.0110.00518.95
8.4.40.0150.00918.47
8.4.30.0180.00819.04
8.4.20.0100.00618.59
8.4.10.0160.00620.48
8.3.260.0100.01016.58
8.3.250.0140.00418.79
8.3.240.0110.00617.02
8.3.230.0050.00416.64
8.3.220.0100.00820.75
8.3.210.0100.00918.31
8.3.200.0070.01116.62
8.3.190.0210.00616.79
8.3.180.0150.00318.00
8.3.170.0190.00818.72
8.3.160.0120.00917.73
8.3.150.0170.00816.65
8.3.140.0160.00317.38
8.3.130.0110.00617.41
8.3.120.0080.00518.63
8.3.110.0060.00716.49
8.3.100.0120.00320.30
8.3.90.0140.00621.55
8.3.80.0120.00317.35
8.3.70.0170.00616.50
8.3.60.0190.00318.26
8.3.50.0220.00516.63
8.3.40.0170.01018.54
8.3.30.0140.00617.86
8.3.20.0180.00820.75
8.3.10.0190.00520.97
8.3.00.0080.00821.76
8.2.290.0080.01120.45
8.2.280.0150.00518.29
8.2.270.0170.00716.92
8.2.260.0220.00416.46
8.2.250.0180.00517.44
8.2.240.0090.00617.72
8.2.230.0120.00218.74
8.2.220.0110.00326.91
8.2.210.0160.00721.60
8.2.200.0120.00216.37
8.2.190.0170.00316.56
8.2.180.0170.00716.40
8.2.170.0110.00618.40
8.2.160.0130.01220.35
8.2.150.0130.00921.61
8.2.140.0090.00421.17
8.2.130.0100.00621.90
8.2.120.0120.00221.85
8.2.110.0130.00219.35
8.2.100.0100.00419.14
8.2.90.0110.00518.57
8.2.80.0150.00318.22
8.2.70.0130.00217.63
8.2.60.0070.00617.76
8.2.50.0070.00617.85
8.2.40.0070.00617.90
8.2.30.0060.00717.82
8.2.20.0100.00518.17
8.2.10.0090.00417.95
8.2.00.0120.00417.96
8.1.330.0130.00521.95
8.1.320.0050.00416.21
8.1.310.0120.00216.38
8.1.300.0100.00818.00
8.1.290.0130.00223.34
8.1.280.0160.00620.93
8.1.270.0160.00420.93
8.1.260.0100.00821.71
8.1.250.0150.00622.67
8.1.240.0160.00918.31
8.1.230.0090.00518.91
8.1.220.0110.00217.44
8.1.210.0190.00717.92
8.1.200.0160.00617.20
8.1.190.0120.00817.23
8.1.180.0180.00917.59
8.1.170.0160.00517.95
8.1.160.0130.00918.01
8.1.150.0100.00617.71
8.1.140.0140.00317.76
8.1.130.0140.00617.71
8.1.120.0160.00517.71
8.1.110.0170.00417.73
8.1.100.0130.00717.68
8.1.90.0120.00817.81
8.1.80.0130.00717.80
8.1.70.0150.00517.74
8.1.60.0180.00517.92
8.1.50.0170.00317.82
8.1.40.0150.00817.89
8.1.30.0180.00517.93
8.1.20.0150.00418.01
8.1.10.0120.00617.87
8.1.00.0170.00817.58
8.0.300.0150.00718.14
8.0.290.0230.00316.68
8.0.280.0160.00717.46
8.0.270.0170.00417.10
8.0.260.0120.00517.10
8.0.250.0120.00517.10
8.0.240.0130.00217.07
8.0.230.0090.00617.14
8.0.220.0110.00717.01
8.0.210.0160.00517.01
8.0.200.0160.00417.10
8.0.190.0140.00717.13
8.0.180.0140.00517.10
8.0.170.0140.00517.04
8.0.160.0150.00217.22
8.0.150.0170.00317.05
8.0.140.0150.00517.02
8.0.130.0170.00317.06
8.0.120.0140.00617.00
8.0.110.0130.00417.02
8.0.100.0140.00617.10
8.0.90.0130.00517.09
8.0.80.0130.00317.06
8.0.70.0120.00517.11
8.0.60.0170.00317.06
8.0.50.0150.00417.10
8.0.30.0080.00717.12
8.0.20.0140.00317.17
8.0.10.0090.00717.08

preferences:
27.48 ms | 403 KiB | 5 Q