3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = mb_convert_encoding("ア", 'JIS', 'UTF-8'); var_dump(mb_detect_encoding($str, 'JIS')); var_dump(mb_detect_encoding($str, 'JIS', true)); var_dump(mb_detect_encoding($str, 'JIS', false)); var_dump(mb_detect_encoding($str, 'ASCII')); var_dump(mb_detect_encoding($str, 'ASCII', true)); var_dump(mb_detect_encoding($str, 'ASCII', false)); var_dump(mb_detect_encoding($str, ['ASCII', 'JIS'])); var_dump(mb_detect_encoding($str, ['ASCII', 'JIS'], true)); var_dump(mb_detect_encoding($str, ['ASCII', 'JIS'], 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.4.140.0120.00817.64
8.4.130.0060.00718.60
8.4.120.0120.00824.33
8.4.110.0130.00922.59
8.4.100.0100.01118.65
8.4.90.0100.01018.78
8.4.80.0100.01018.87
8.4.70.0130.00818.21
8.4.60.0070.00318.97
8.4.50.0120.00820.32
8.4.40.0100.00617.92
8.4.30.0180.00420.76
8.4.20.0100.01018.09
8.4.10.0060.00319.65
8.3.270.0110.00816.37
8.3.260.0050.00316.64
8.3.250.0120.00718.87
8.3.240.0090.01218.85
8.3.230.0120.00816.64
8.3.220.0110.00718.95
8.3.210.0130.00516.67
8.3.200.0050.00316.68
8.3.190.0110.01117.30
8.3.180.0120.00717.17
8.3.170.0000.00819.05
8.3.160.0150.00417.17
8.3.150.0140.00417.08
8.3.140.0090.00916.63
8.3.130.0060.00318.24
8.3.120.0090.00020.96
8.3.110.0100.00020.94
8.3.100.0000.01024.06
8.3.90.0080.00326.77
8.3.80.0090.00617.97
8.3.70.0170.00716.50
8.3.60.0120.00316.63
8.3.50.0100.00616.43
8.3.40.0100.00322.05
8.3.30.0090.00621.91
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0050.00326.16
8.2.290.0130.00720.23
8.2.280.0120.00616.79
8.2.270.0040.00417.37
8.2.260.0140.00416.57
8.2.250.0050.00518.49
8.2.240.0000.00817.55
8.2.230.0030.00622.58
8.2.220.0030.00637.54
8.2.210.0070.00026.77
8.2.200.0100.00316.88
8.2.190.0110.01118.66
8.2.180.0030.01818.66
8.2.170.0120.00318.99
8.2.160.0130.00622.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0000.00819.61
8.2.110.0070.00320.63
8.2.100.0040.00719.28
8.2.90.0110.00818.82
8.2.80.0080.00818.86
8.2.70.0060.01218.84
8.2.60.0090.00919.02
8.2.50.0110.00718.61
8.2.40.0080.00818.95
8.2.30.0110.00418.90
8.2.20.0130.00318.84
8.2.10.0180.00019.19
8.2.00.0180.00919.30
8.1.330.0120.00721.90
8.1.320.0080.00818.12
8.1.310.0030.01016.99
8.1.300.0070.01120.37
8.1.290.0140.00318.88
8.1.280.0090.00625.92
8.1.270.0030.00524.04
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0130.00418.66
8.1.230.0130.00418.70
8.1.220.0120.00418.63
8.1.210.0100.00719.99
8.1.200.0150.00018.73
8.1.190.0090.00618.47
8.1.180.0110.00618.50
8.1.170.0250.00618.76
8.1.160.0090.00518.79
8.1.150.0100.00320.63
8.1.140.0130.00418.70
8.1.130.0270.00718.61
8.1.120.0220.00018.82
8.1.110.0140.01418.70
8.1.100.0120.00618.79
8.1.90.0220.00718.74
8.1.80.0130.01318.80
8.1.70.0000.01318.91
8.1.60.0230.01018.68
8.1.50.0200.00518.78
8.1.40.0110.00519.09
8.1.30.0060.00918.99
8.1.20.0140.00518.79
8.1.10.0080.00819.07
8.1.00.0100.00518.74
8.0.300.0110.00617.93
8.0.290.0140.00717.67
8.0.280.0120.00617.83
8.0.270.0180.00017.89
8.0.260.0130.00517.95
8.0.250.0140.00517.94
8.0.240.0110.00617.96
8.0.230.0150.00018.46
8.0.220.0300.01017.96
8.0.210.0210.01417.81
8.0.200.0110.00817.89
8.0.190.0130.00817.99
8.0.180.0130.00518.06
8.0.170.0150.00017.86
8.0.160.0340.00317.83
8.0.150.0160.00317.96
8.0.140.0170.00317.73
8.0.130.0220.01018.20
8.0.120.0320.00617.95
8.0.110.0240.00818.00
8.0.100.0200.00317.66
8.0.90.0150.00917.84
8.0.80.0180.00017.88
8.0.70.0160.00017.93
8.0.60.0170.01017.83
8.0.50.0230.01517.87
8.0.30.0150.00818.01
8.0.20.0130.00418.08
8.0.10.0250.00017.99

preferences:
28.27 ms | 403 KiB | 5 Q