3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "\xC4\xA2"; // The string is valid in all three encodings, so the first one listed will be returned var_dump(mb_detect_encoding($str, ['UTF-8', 'ISO-8859-1', 'ISO-8859-5'])); var_dump(mb_detect_encoding($str, ['ISO-8859-1', 'ISO-8859-5', 'UTF-8'])); var_dump(mb_detect_encoding($str, ['ISO-8859-5', 'UTF-8', 'ISO-8859-1']));

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.00919.86
8.4.150.0020.00014.05
8.4.140.0160.00517.45
8.4.130.0140.00618.08
8.4.120.0120.00822.22
8.4.110.0160.00518.77
8.4.100.0120.00817.61
8.4.90.0130.00817.77
8.4.80.0110.00619.32
8.4.70.0090.01017.68
8.4.60.0120.00818.45
8.4.50.0070.00517.86
8.4.40.0060.01319.56
8.4.30.0130.00718.67
8.4.20.0190.00017.72
8.4.10.0040.00421.89
8.3.280.0130.00718.16
8.3.270.0130.01316.57
8.3.260.0080.01116.27
8.3.250.0080.00918.79
8.3.240.0040.00416.44
8.3.230.0120.00816.55
8.3.220.0140.00518.43
8.3.210.0120.00616.62
8.3.200.0070.00416.36
8.3.190.0100.00818.59
8.3.180.0110.00718.12
8.3.170.0120.00617.07
8.3.160.0040.01416.50
8.3.150.0090.00917.16
8.3.140.0100.00716.79
8.3.130.0080.00018.32
8.3.120.0050.00518.80
8.3.110.0110.00720.94
8.3.100.0080.00024.06
8.3.90.0040.01126.77
8.3.80.0090.00316.63
8.3.70.0110.00716.58
8.3.60.0030.01018.18
8.3.50.0140.00720.03
8.3.40.0040.01120.38
8.3.30.0070.00718.51
8.3.20.0060.00724.92
8.3.10.0080.00525.16
8.3.00.0050.00825.91
8.2.290.0110.00818.92
8.2.280.0150.00318.45
8.2.270.0120.00616.89
8.2.260.0120.00319.10
8.2.250.0090.01217.10
8.2.240.0090.00017.24
8.2.230.0030.00622.58
8.2.220.0090.00037.54
8.2.210.0040.00426.77
8.2.200.0040.00818.52
8.2.190.0090.00616.75
8.2.180.0170.00325.92
8.2.170.0100.00719.26
8.2.160.0040.01122.96
8.2.150.0070.00425.66
8.2.140.0080.00425.16
8.2.130.0050.00625.91
8.2.120.0040.00425.91
8.2.110.0100.00423.15
8.2.100.0090.00721.79
8.2.90.0020.00722.44
8.2.80.0100.00321.82
8.2.70.0070.00121.71
8.2.60.0000.00821.92
8.2.50.0090.00421.87
8.2.40.0010.00722.77
8.2.30.0090.00421.89
8.2.20.0050.00322.55
8.2.10.0080.00321.93
8.2.00.0110.00022.52
8.1.330.0120.00816.36
8.1.320.0090.01216.41
8.1.310.0000.01716.90
8.1.300.0060.00318.22
8.1.290.0040.00430.84
8.1.280.0120.00625.92
8.1.270.0070.00425.16
8.1.260.0030.00526.01
8.1.250.0020.00826.88
8.1.240.0030.00624.26
8.1.230.0040.00621.81
8.1.220.0060.00621.70
8.1.210.0020.00722.22
8.1.200.0030.00621.57
8.1.190.0060.00621.57
8.1.180.0060.00721.88
8.1.170.0040.00422.23
8.1.160.0040.00422.29
8.1.150.0030.00522.17
8.1.140.0050.00321.62
8.1.130.0050.00722.40
8.1.120.0030.00521.58
8.1.110.0040.00421.56
8.1.100.0040.01219.53
8.1.90.0080.00619.54
8.1.80.0070.00619.56
8.1.70.0090.00319.53
8.1.60.0080.00519.60
8.1.50.0100.00719.60
8.1.40.0090.00719.61
8.1.30.0110.00719.68
8.1.20.0100.00519.67
8.1.10.0120.00519.56
8.1.00.0130.00219.60
8.0.300.0100.00222.22
8.0.290.0100.00221.21
8.0.280.0080.00422.11
8.0.270.0040.00721.28
8.0.260.0070.00622.09
8.0.250.0060.00521.32
8.0.240.0170.00221.34
8.0.230.0080.00619.08
8.0.220.0060.00719.04
8.0.210.0110.00419.09
8.0.200.0070.00619.08
8.0.190.0120.00519.13
8.0.180.0090.00519.06
8.0.170.0110.00419.03
8.0.160.0080.00519.06
8.0.150.0120.00319.02
8.0.140.0110.00419.05
8.0.130.0090.00519.07
8.0.120.0110.00419.08
8.0.110.0100.00319.02
8.0.100.0100.00419.08
8.0.90.0120.00319.08
8.0.80.0110.00319.05
8.0.70.0070.00719.02
8.0.60.0100.00519.09
8.0.50.0110.00419.08
8.0.30.0110.00319.02
8.0.20.0070.00619.17
8.0.10.0100.00519.07
7.4.330.0040.00220.61
7.4.320.0100.00221.19
7.4.300.0130.00318.87
7.4.290.0120.00518.84
7.4.280.0140.00318.85
7.4.270.0120.00318.83
7.4.260.0110.00518.80
7.4.250.0130.00418.80
7.4.240.0180.00418.82
7.4.230.0090.00618.79
7.4.220.0160.00418.86
7.4.210.0170.00318.83
7.4.200.0160.00318.83
7.4.190.0170.00318.89
7.4.180.0150.00518.86
7.4.160.0150.00518.84
7.4.150.0180.00218.79
7.4.140.0150.00518.90
7.4.130.0140.00418.79
7.4.120.0140.00318.78
7.4.110.0150.00518.85
7.4.100.0140.00418.88
7.4.90.0140.00318.78
7.4.80.0140.00318.78
7.4.70.0100.00418.77
7.4.60.0120.00218.71
7.4.50.0090.00318.72
7.4.40.0100.00318.64
7.4.30.0070.00718.80
7.4.20.0110.00618.78
7.4.10.0100.00418.74
7.4.00.0100.00718.81

preferences:
30.08 ms | 403 KiB | 5 Q